Skip to content

Commit 226b36f

Browse files
authored
Add podman support for the build and deploy scripts (#244)
* add podman support to build.sh Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * podman support for build_and_deploy.sh and update docs Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add podman capabilities to build scripts and update docs for usage Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove commented out block Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * typo fix Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> --------- Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent 1464914 commit 226b36f

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.ci/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
shopt -s expand_aliases
1516

1617
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18+
USE_PODMAN=${USE_PODMAN:-false}
19+
20+
if [[ ${USE_PODMAN} == true ]]; then
21+
alias docker=podman
22+
echo "using podman as container engine"
23+
fi
1724

1825
if [ $# -eq 1 ] && [ $1 == "offline" ]
1926
then

.ci/build_and_deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
shopt -s expand_aliases
1516
set -ex
1617
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1718
GIT_REV="$(git rev-parse --short=7 HEAD)"
1819
INDEX_IMAGE="${INDEX_IMAGE:-quay.io/app-sre/devfile-index}"
1920
VIEWER_IMAGE="${VIEWER_IMAGE:-quay.io/app-sre/registry-viewer}"
2021
IMAGE_TAG="${IMAGE_TAG:-${GIT_REV}}"
22+
USE_PODMAN=${USE_PODMAN:-false}
23+
24+
# Ensure container engine is set properly for devfile-web scripts
25+
if [[ ${USE_PODMAN} == true ]]; then
26+
alias docker=podman
27+
echo "using podman as container engine"
28+
fi
2129

2230
# Run the build script
2331
bash $ABSOLUTE_PATH/build.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you are a stack owner and need to request an urgent refresh of <https://regis
2929

3030
### Build
3131

32-
To build this devfile registry into a container image run `bash .ci/build.sh`. A container image will be built using the [devfile registry build tools](https://github.com/devfile/registry-support/tree/master/build-tools).
32+
To build this devfile registry into a container image run `bash .ci/build.sh`. A container image will be built using the [devfile registry build tools](https://github.com/devfile/registry-support/tree/master/build-tools). By default these scripts will use `docker`, if you want to use `podman` you should first run `export USE_PODMAN=true` before executing the build script.
3333

3434
From there, push the container image to a container registry of your choice and deploy using one of the methods outlined [here](https://github.com/devfile/registry-support#deploy).
3535

0 commit comments

Comments
 (0)