Skip to content

Commit

Permalink
Revert "chore(docker-tag): do not fail if tag already exists (#174)"
Browse files Browse the repository at this point in the history
This reverts commit 1eee321.
  • Loading branch information
floriantz authored Oct 21, 2024
1 parent 1eee321 commit 2098f52
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/docker-tag-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,5 @@ jobs:
- name: Tag image
run: |
IMAGE_EXISTS=$(aws ecr describe-images --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_to }} 2>/dev/null)
if [[ -z "$IMAGE_EXISTS" ]]; then
MANIFEST=$(aws ecr batch-get-image --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_from }} --output text --query 'images[].imageManifest')
aws ecr put-image --repository-name ${{ inputs.image_name }} --image-tag ${{ inputs.image_tag_to }} --image-manifest "$MANIFEST"
else
echo "image ${{ inputs.image_name }} tag ${{ inputs.image_tag_to }} already exists. Skipping..."
fi
MANIFEST=$(aws ecr batch-get-image --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_from }} --output text --query 'images[].imageManifest')
aws ecr put-image --repository-name ${{ inputs.image_name }} --image-tag ${{ inputs.image_tag_to}} --image-manifest "$MANIFEST"

0 comments on commit 2098f52

Please sign in to comment.