Skip to content

Commit e37cd6b

Browse files
authored
Implementation for podman to be used for container images (#1357)
* add setenv script Signed-off-by: Jordan Dubrick <[email protected]> * update run script to include podman capabilities Signed-off-by: Jordan Dubrick <[email protected]> * update documentation to reflect podman implementation Signed-off-by: Jordan Dubrick <[email protected]> * update documentation to remove duplicate entries Signed-off-by: Jordan Dubrick <[email protected]> * add inline setting of alias to remove need for additional script Signed-off-by: Jordan Dubrick <[email protected]> * fix unset variable Signed-off-by: Jordan Dubrick <[email protected]> --------- Signed-off-by: Jordan Dubrick <[email protected]> Signed-off-by: Jordan Dubrick <[email protected]>
1 parent adb72c3 commit e37cd6b

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

CONTRIBUTING.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@ Before contributing to this repository for the first time, please review our pro
1616

1717
### Building
1818

19-
To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`.
20-
In the root directory, just run the following command:
19+
To build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker` or `podman`.
20+
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:
2121

2222
```console
2323
bash ./docker-run.sh ./build.sh
2424
```
2525

26+
### Typescript model
27+
28+
Typescript model is generated based on JSON Schema with help of <https://github.com/kubernetes-client/gen>.
29+
To generate them locally run:
30+
31+
```console
32+
bash ./build/typescript-model/generate.sh
33+
```
34+
2635
### Testing
2736

2837
Find more information about tests in the [testing document](test/README.md).

README.md

+3-15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Sources for this API are defined in Go code, starting from the
1111
[devworkspace_types.go source file](pkg/apis/workspaces/v1alpha2/devworkspace_types.go)
1212

1313
From these Go sources, several files are generated:
14+
1415
- A Kubernetes Custom Resource Definition(CRD) with an embedded OpenApi schema,
1516
- json schemas (in the [schemas](schemas) folder) generated from the above CRD, to specify the syntax of:
1617
- the DevWorkspace CRD itself;
@@ -34,21 +35,7 @@ Release details and process are found in [Devfile Release](RELEASE.md)
3435

3536
## How to build
3637

37-
In order to build the CRD and the various schemas, you don't need to install any pre-requisite apart from `docker`.
38-
In the root directory, just run the following command:
39-
40-
```console
41-
bash ./docker-run.sh ./build.sh
42-
```
43-
44-
### Typescript model
45-
46-
Typescript model is generated based on JSON Schema with help of <https://github.com/kubernetes-client/gen>.
47-
To generate them locally run:
48-
49-
```console
50-
bash ./build/typescript-model/generate.sh
51-
```
38+
For information about building this project visit [CONTRIBUTING.md](./CONTRIBUTING.md#building).
5239

5340
## Specification status
5441

@@ -61,6 +48,7 @@ In order to test existing or new Devfile 2.0 or DevWorkspace sample files in a s
6148
[![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)
6249

6350
As soon as the devworkspace is opened, you should be able to:
51+
6452
- open the `yaml` files in the following folders:
6553
- `samples/`
6654
- `devfile-support/samples`

docker-run.sh

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18+
# Allow setting of podman environment var in the script runtime
19+
shopt -s expand_aliases
20+
set -eux
1821

1922
# git ROOT directory used to mount filesystem
2023
GIT_ROOT_DIRECTORY=$(git rev-parse --show-toplevel)
@@ -23,6 +26,13 @@ WORKDIR="/projects/src/${GO_MODULE}"
2326
# Container image
2427
IMAGE_NAME="quay.io/devfile/kubernetes-api-build-prerequisites:latest"
2528

29+
# For users who want to use podman this enables the alias to work throughout the scripts runtime
30+
USE_PODMAN=${USE_PODMAN:-false}
31+
if [[ ${USE_PODMAN} == true ]]; then
32+
alias docker=podman
33+
echo "using podman as container engine"
34+
fi
35+
2636
init() {
2737
BLUE='\033[1;34m'
2838
GREEN='\033[0;32m'

0 commit comments

Comments
 (0)