diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02ee6799e..623a2fe8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,13 +16,22 @@ Before contributing to this repository for the first time, please review our pro ### Building -To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`. -In the root directory, just run the following command: +To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker` or `podman`. +In the root directory, if you are using `podman` first run `export USE_PODMAN=true`. Then for either `docker` or `podman` run the following command: ```console bash ./docker-run.sh ./build.sh ``` +### Typescript model + +Typescript model is generated based on JSON Schema with help of . +To generate them locally run: + +```console +bash ./build/typescript-model/generate.sh +``` + ### Testing Find more information about tests in the [testing document](test/README.md). diff --git a/README.md b/README.md index 7b79caf2f..ced708f2b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Sources for this API are defined in Go code, starting from the [devworkspace_types.go source file](pkg/apis/workspaces/v1alpha2/devworkspace_types.go) From these Go sources, several files are generated: + - A Kubernetes Custom Resource Definition(CRD) with an embedded OpenApi schema, - json schemas (in the [schemas](schemas) folder) generated from the above CRD, to specify the syntax of: - the DevWorkspace CRD itself; @@ -34,21 +35,7 @@ Release details and process are found in [Devfile Release](RELEASE.md) ## How to build -In order to build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`. -In the root directory, just run the following command: - -```console -bash ./docker-run.sh ./build.sh -``` - -### Typescript model - -Typescript model is generated based on JSON Schema with help of . -To generate them locally run: - -```console -bash ./build/typescript-model/generate.sh -``` +For information about building this project visit [CONTRIBUTING.md](./CONTRIBUTING.md#building). ## Specification status @@ -61,6 +48,7 @@ In order to test existing or new Devfile 2.0 or DevWorkspace sample files in a s [![Contribute](https://img.shields.io/badge/developer-workspace-525C86?logo=eclipse-che&labelColor=FDB940)](https://workspaces.openshift.com/f?url=https://github.com/devfile/api) As soon as the devworkspace is opened, you should be able to: + - open the `yaml` files in the following folders: - `samples/` - `devfile-support/samples` diff --git a/docker-run.sh b/docker-run.sh index 9485421d1..820380a9f 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -15,6 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Allow setting of podman environment var in the script runtime +shopt -s expand_aliases +set -eux # git ROOT directory used to mount filesystem GIT_ROOT_DIRECTORY=$(git rev-parse --show-toplevel) @@ -23,6 +26,13 @@ WORKDIR="/projects/src/${GO_MODULE}" # Container image IMAGE_NAME="quay.io/devfile/kubernetes-api-build-prerequisites:latest" +# For users who want to use podman this enables the alias to work throughout the scripts runtime +USE_PODMAN=${USE_PODMAN:-false} +if [[ ${USE_PODMAN} == true ]]; then + alias docker=podman + echo "using podman as container engine" +fi + init() { BLUE='\033[1;34m' GREEN='\033[0;32m'