From 78430407d96d8943ea6f33e8e7fc83c1b87de5ad Mon Sep 17 00:00:00 2001 From: Sean Fern Date: Sat, 5 Oct 2024 13:35:26 -0400 Subject: [PATCH] Fixes for prod_test and SHA_SHORT --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/promote.yml | 12 ++++++------ .github/workflows/release.yml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 69b1e45a3..9d0b8f93f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ on: - test - sbx - prod - - prod-test + - prod_test module: required: true type: choice @@ -35,7 +35,7 @@ jobs: id-token: write env: DEPLOYMENT_ENV: ${{ vars[format('{0}_DEPLOYMENT_ENV', inputs.environment)] }} - ACCOUNT: ${{ inputs.environment == 'prod-test' && 'prod' || inputs.environment }} + ACCOUNT: ${{ inputs.environment == 'prod_test' && 'prod' || inputs.environment }} steps: - uses: aws-actions/configure-aws-credentials@v3 diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 59a90a6bf..7328e0689 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -17,7 +17,7 @@ on: options: - sbx - prod - - prod-test + - prod_test module: required: true type: choice @@ -47,14 +47,14 @@ jobs: SHA_SHORT=82d2398 # TODO remove after testing echo "Getting the manifest of the image pushed with the latest commit to main at sha $SHA_SHORT" - MANIFEST=$(aws ecr batch-get-image --repository-name "$REPO" --image-ids imageTag=main-$SHORT_SHA --output text --query 'images[].imageManifest') + MANIFEST=$(aws ecr batch-get-image --repository-name "$REPO" --image-ids imageTag=main-$SHA_SHORT --output text --query 'images[].imageManifest') SHA_TAG="ab2d-$DEPLOYMENT_ENV-$SHA_SHORT" - echo "Adding the tag for $SHA_TAG to main-$SHORT_SHA image" + echo "Adding the tag for $SHA_TAG to main-$SHA_SHORT image" # Avoid failure on existing image and tag if ! OUT=$(2>&1 aws ecr put-image --repository-name "$REPO" --image-tag "$SHA_TAG" --image-manifest "$MANIFEST"); then if echo "$OUT" | grep ImageAlreadyExistsException > /dev/null; then - echo "Image for main-$SHORT_SHA has already been tagged with $SHA_TAG" + echo "Image for main-$SHA_SHORT has already been tagged with $SHA_TAG" else >&2 echo "$OUT" exit 1 @@ -62,10 +62,10 @@ jobs: fi LATEST_TAG="ab2d-$DEPLOYMENT_ENV-latest" - echo "Adding the tag for $LATEST_TAG to main-$SHORT_SHA image" + echo "Adding the tag for $LATEST_TAG to main-$SHA_SHORT image" if ! OUT=$(2>&1 aws ecr put-image --repository-name "$REPO" --image-tag "$LATEST_TAG" --image-manifest "$MANIFEST"); then if echo "$OUT" | grep ImageAlreadyExistsException > /dev/null; then - echo "Image for main-$SHORT_SHA has already been tagged with $LATEST_TAG" + echo "Image for main-$SHA_SHORT has already been tagged with $LATEST_TAG" else >&2 echo "$OUT" exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e33cda79..55a882cea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: promote-prod-test-worker: uses: ./.github/workflows/promote.yml with: - environment: prod-test + environment: prod_test module: worker secrets: inherit @@ -23,7 +23,7 @@ jobs: needs: promote-prod-test-worker uses: ./.github/workflows/deploy.yml with: - environment: prod-test + environment: prod_test module: worker secrets: inherit