diff --git a/bin/build_utils b/bin/build_utils index 11e2b16a..aee8b22e 100644 --- a/bin/build_utils +++ b/bin/build_utils @@ -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}" } diff --git a/bin/publish b/bin/publish index ce7b2ad1..102dd19a 100755 --- a/bin/publish +++ b/bin/publish @@ -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