Skip to content

Commit c45b614

Browse files
committed
Update scripts to work with podman
Signed-off-by: Kim Tsao <[email protected]>
1 parent 723fa9c commit c45b614

File tree

8 files changed

+28
-5
lines changed

8 files changed

+28
-5
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Issue tracking repo: https://github.com/devfile/api with label area/registry
66

77
## Build
88

9+
If you want to run the build scripts with Podman, set the environment variable
10+
`export USE_PODMAN=true`
11+
912
To build all of the components together (recommended) for dev/test, run `./build_registry.sh` to build a Devfile Registry index image that is populated with the mock devfile registry data under `tests/registry/`.
1013

1114
Once the container has been pushed, you can push it to a container registry of your choosing with the following commands:

TROUBLESHOOTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Troubelshooting the Devfile Registry
1+
# Troubleshooting the Devfile Registry
22

33
## Collecting Logs
44

build_registry.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
# This can be useful if developing components within this repository (such as the index server or build tools)
55
# and want to test all of the components together
66

7-
set -eux
7+
set -eu
8+
#set the docker alias if necessary
9+
. setenv.sh
810

911
# Build the index server base image
10-
./index/server/build.sh
12+
. index/server/build.sh
1113

1214
# Build the test devfile registry image
1315
docker build -t devfile-index:latest -f .ci/Dockerfile .

index/server/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# Build the index container for the registry
4-
buildfolder="$(realpath $(dirname $0))"
4+
buildfolder="$(realpath $(dirname ${BASH_SOURCE[0]}))"
55

66
# Clone the registry-support repo
77
if [ -d $buildfolder/registry-viewer ]; then

setenv.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This script aliases the docker cli if the environment variable USE_PODMAN is set to true.
4+
5+
# default value is false if USE_PODMAN is unset or null
6+
podman=${USE_PODMAN:-false}
7+
if [ ${podman} == true ]; then
8+
alias docker=podman
9+
echo "setting alias docker=podman"
10+
fi

tests/integration/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This folder contains the integration tests for the OCI-based Devfile Registry. The tests can be run against either a remote devfile registry (such as https://registry.stage.devfile.io), or a local devfile registry running your machine (such as in Minikube, or Docker Desktop).
44

55
## Build
6+
If you want to run the build scripts with Podman, set the environment variable
7+
`export USE_PODMAN=true`
68

79
The integration tests can be built to either run in a Docker container, or locally on your machine.
810

tests/integration/docker-build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
#set the docker alias if necessary
4+
. ../../setenv.sh
35
# Get the registry-library
46
cp -rf ../../registry-library ./
57

tests/integration/docker-push.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/sh
2+
3+
#set the docker alias if necessary
4+
. ../../setenv.sh
5+
26
IMAGE_TAG=$1
37
docker tag devfile-registry-integration $IMAGE_TAG
48
docker push $IMAGE_TAG

0 commit comments

Comments
 (0)