Skip to content

Commit

Permalink
Merge pull request #35 from jordojordo/main
Browse files Browse the repository at this point in the history
Add docker runtime to package script
  • Loading branch information
jordojordo authored Nov 30, 2023
2 parents f295517 + a486eea commit 8b6cb91
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/bundle-catalog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DEST_IMAGE_NAME="ui-plugin-catalog"
DEST_TAG="latest"
DEST_REGISTRY=""
DEST_NAMESPACE="rancher"
RUNTIME="docker"

usage() {
echo "Usage: $0 [<options>]"
Expand Down Expand Up @@ -210,20 +211,20 @@ if [[ -n ${DEST_REGISTRY} ]]; then
fi

if [ ! -z "${IMAGE}" ]; then
REGISTRY=${DEST_REGISTRY} ORG=${DEST_NAMESPACE} REPO=${DEST_IMAGE_NAME} TAG=${DEST_TAG} ./scripts/package
REGISTRY=${DEST_REGISTRY} ORG=${DEST_NAMESPACE} REPO=${DEST_IMAGE_NAME} TAG=${DEST_TAG} RUNTIME=${RUNTIME} ./scripts/package

echo -e "${CYAN}Pushing container image ...${RESET}"

# Ensure that you do not overwrite production images
if [[ "${DEST_NAMESPACE}" == "rancher" ]]; then
if docker manifest inspect ${IMAGE} 2>&1 1>/dev/null; then
if ${RUNTIME} manifest inspect ${IMAGE} 2>&1 1>/dev/null; then
echo -e "${RED}${BOLD}Cannot overwrite production image ${DEST_IMAGE_NAME} since it already exists${RESET}"
rm -rf ${TMP}
exit 1
fi
fi

docker push ${IMAGE}
${RUNTIME} push ${IMAGE}
fi

popd > /dev/null
Expand Down

0 comments on commit 8b6cb91

Please sign in to comment.