Skip to content

Commit

Permalink
CNJR-4327: Fix Promote
Browse files Browse the repository at this point in the history
- Don't save the docker image on promote.
  • Loading branch information
neil-k-zero committed Dec 4, 2024
1 parent 2823b2e commit bf8a6d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bin/build_utils
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ function tag_and_push() {
shift
local target="$1"
shift
local promote="${1:-false}"

docker tag "${source}" "${target}"
# Save the docker image for artifact signing
docker save -o "docker-image-${source}".tar "${source}"
# Save the docker image for artifact signing unless this is a promote
if [ "$promote" = false ]; then
echo "saving docker image: docker-image-${source}.tar in $(pwd)"
docker save -o "docker-image-${source}.tar" "${source}"
fi
docker push "${target}"
}

Expand Down
4 changes: 2 additions & 2 deletions bin/publish
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ if [[ ${PROMOTE} = true ]]; then
# Publish images to docker hub
for tag in "${TAGS[@]}" $(gen_versions "$REMOTE_TAG"); do
echo "Tagging and pushing $REGISTRY/$IMAGE_NAME:$tag"
tag_and_push "${LOCAL_REGISTRY}/$IMAGE_NAME:$SOURCE_TAG" "$REGISTRY/$IMAGE_NAME:$tag"
tag_and_push "${LOCAL_REGISTRY}/${REDHAT_LOCAL_IMAGE}:${SOURCE_TAG}" "$REGISTRY/${REDHAT_LOCAL_IMAGE}:$tag"
tag_and_push "${LOCAL_REGISTRY}/$IMAGE_NAME:$SOURCE_TAG" "$REGISTRY/$IMAGE_NAME:$tag" "${PROMOTE}"
tag_and_push "${LOCAL_REGISTRY}/${REDHAT_LOCAL_IMAGE}:${SOURCE_TAG}" "$REGISTRY/${REDHAT_LOCAL_IMAGE}:$tag" "${PROMOTE}"
done


Expand Down

0 comments on commit bf8a6d3

Please sign in to comment.