Skip to content

Commit

Permalink
[circleci] fix main image tag when exists
Browse files Browse the repository at this point in the history
Closes: #230
  • Loading branch information
rustielin authored and aptos-bot committed Mar 17, 2022
1 parent 9f6c170 commit 4fd4b0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ jobs:
for img in "${imgs[@]}"
do
MANIFEST=$(aws ecr batch-get-image --repository-name aptos/${img} --image-ids imageTag=$IMAGE_TAG --query 'images[].imageManifest' --output text)
aws ecr put-image --repository-name aptos/${img} --image-tag main --image-manifest "$MANIFEST" || ret=$?
put_img_out=$(aws ecr put-image --repository-name aptos/${img} --image-tag main --image-manifest "$MANIFEST" 2>&1)
ret=$?
# ok if image tag exists and cannot overwrite
echo $put_img_out | grep 'ImageAlreadyExistsException' && ret=0
done
exit $ret
fi
Expand Down

0 comments on commit 4fd4b0b

Please sign in to comment.