Skip to content

Commit dbd6c68

Browse files
authored
Merge pull request devfile#101 from kim-tsao/update-scripts
Update scripts to work with podman
2 parents 723fa9c + cb0e729 commit dbd6c68

File tree

9 files changed

+31
-11
lines changed

9 files changed

+31
-11
lines changed

README.md

Lines changed: 3 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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-tools/build.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
#!/bin/bash
12
#
2-
# Copyright (c) 2020 Red Hat, Inc.
3+
# Copyright (c) 2020-2022 Red Hat, Inc.
34
# This program and the accompanying materials are made
45
# available under the terms of the Eclipse Public License 2.0
56
# which is available at https://www.eclipse.org/legal/epl-2.0/
67
#
78
# SPDX-License-Identifier: EPL-2.0
89
#
910

10-
#!/bin/bash
11-
12-
# Enable extended globbing in the shell
13-
shopt -s extglob
1411

1512
buildToolsFolder="$(dirname "$0")"
1613
generatorFolder=$buildToolsFolder/../index/generator

build_registry.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# This script builds a devfile registry index container image based on the mock devfile registry data under tests/registry
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
6-
6+
shopt -s expand_aliases
77
set -eux
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 10 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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)