Skip to content

Commit

Permalink
fix immediate exit issue when version check is not successful
Browse files Browse the repository at this point in the history
  • Loading branch information
zhonghui12 committed Aug 27, 2021
1 parent ee2e836 commit d579061
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,18 @@ verify_ecr() {

check_image_version() {
export DOCKER_CLI_EXPERIMENTAL=enabled
EXIT_CODE=0

docker_hub_login

# check if we can get the image information in dockerhub; if yes, the exit status should be 0
docker manifest inspect amazon/aws-for-fluent-bit:${1} > /dev/null
if [ "$?" = "0" ]; then
docker manifest inspect amazon/aws-for-fluent-bit:${1} > /dev/null || EXIT_CODE=$?
if [ "${EXIT_CODE}" = "0" ]; then
echo "Accidental release: current image version from github source file match a previous version from dockerhub."
exit 1
fi

echo "Approved release: release the image with a new version."
}

verify_ecr_image_scan() {
Expand Down

0 comments on commit d579061

Please sign in to comment.