Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker runtime to package script #35

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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