From 9c421d197a4f1619fc780eb14eac3e894fe20ee1 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Tue, 4 Feb 2020 09:48:11 -0500 Subject: [PATCH] Allow releases with podman or docker --- hack/build-release.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hack/build-release.sh b/hack/build-release.sh index 3df5fce27..868ced67d 100755 --- a/hack/build-release.sh +++ b/hack/build-release.sh @@ -13,12 +13,14 @@ source "${S2I_ROOT}/hack/common.sh" source "${S2I_ROOT}/hack/util.sh" s2i::log::install_errexit +buildCmd=${S2I_BUILD_CMD:-"podman"} + # Go to the top of the tree. cd "${S2I_ROOT}" # Build the images echo "++ Building openshift/sti-release" -podman build -q --tag openshift/sti-release "${S2I_ROOT}/images/release" +$buildCmd build -q --tag openshift/sti-release "${S2I_ROOT}/images/release" context="${S2I_ROOT}/_output/buildenv-context" @@ -40,9 +42,9 @@ git archive --format=tar -o "${context}/archive.tar" "${S2I_GIT_COMMIT}" tar -rf "${context}/archive.tar" -C "${context}" sti-version-defs gzip -f "${context}/archive.tar" -# Perform the build and release in podman. -cat "${context}/archive.tar.gz" | podman run -i --cidfile="${context}/cid" -e RELEASE_LDFLAGS="-w -s" openshift/sti-release -podman cp $(cat ${context}/cid):/go/src/github.com/openshift/source-to-image/_output/local/releases "${S2I_OUTPUT}" +# Perform the build and release in podman or docker. +cat "${context}/archive.tar.gz" | $buildCmd run -i --cidfile="${context}/cid" -e RELEASE_LDFLAGS="-w -s" openshift/sti-release +$buildCmd cp $(cat ${context}/cid):/go/src/github.com/openshift/source-to-image/_output/local/releases "${S2I_OUTPUT}" echo "${S2I_GIT_COMMIT}" > "${S2I_LOCAL_RELEASEPATH}/.commit" ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"