Skip to content

Commit

Permalink
adding aws actions step to tag rollback image (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmeister committed Sep 24, 2020
1 parent 3a3cf1c commit d1240b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/testnet-ecr-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Tag rollback image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: optimism/geth
IMAGE_TAG: testnet
run: |
MANIFEST=$(aws ecr batch-get-image --repository-name $ECR_REPOSITORY --image-ids imageTag=$IMAGE_TAG --query 'images[].imageManifest' --output text)
ROLLBACK_TAG="${IMAGE_TAG}_ROLLBACK_$(date +%Y-%m-%d_%H_%M_%S)"
aws ecr put-image --repository-name $ECR_REPOSITORY --image-tag $ROLLBACK_TAG --image-manifest "$MANIFEST"
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/uat-ecr-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Tag rollback image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: optimism/geth
IMAGE_TAG: uat
run: |
MANIFEST=$(aws ecr batch-get-image --repository-name $ECR_REPOSITORY --image-ids imageTag=$IMAGE_TAG --query 'images[].imageManifest' --output text)
ROLLBACK_TAG="${IMAGE_TAG}_ROLLBACK_$(date +%Y-%m-%d_%H_%M_%S)"
aws ecr put-image --repository-name $ECR_REPOSITORY --image-tag $ROLLBACK_TAG --image-manifest "$MANIFEST"
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
Expand Down

0 comments on commit d1240b3

Please sign in to comment.