From 49418ae270d2db07b86f9d52fbf9d4f87e60bad0 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 10 Sep 2024 10:09:42 -0400 Subject: [PATCH] Remove APP_ENV --- .github/workflows/deploy_production.yml | 13 ++++++------- .github/workflows/deploy_qa.yml | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy_production.yml b/.github/workflows/deploy_production.yml index b7f58eb99..f1dd4e366 100644 --- a/.github/workflows/deploy_production.yml +++ b/.github/workflows/deploy_production.yml @@ -13,7 +13,6 @@ permissions: env: AWS_DEFAULT_REGION: us-east-1 LOCAL_TAG_NAME: research-catalog:${{ github.ref_name }}-${{ github.run_number }} - APP_ENV: production jobs: deploy: @@ -34,15 +33,15 @@ jobs: - name: Build and push Docker image to Amazon ECR env: - ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:$APP_ENV-latest - MANIFEST: $(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="$APP_ENV-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest') + ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:production-latest + MANIFEST: $(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="production-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest') run: | - docker build --build-arg NEXT_PUBLIC_APP_ENV=$APP_ENV --tag $LOCAL_TAG_NAME . + docker build --build-arg NEXT_PUBLIC_APP_ENV=production --tag $LOCAL_TAG_NAME . docker tag $LOCAL_TAG_NAME $ECR_URL - aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="$APP_ENV-previous" || true - aws ecr put-image --repository-name research-catalog --image-tag "$APP_ENV-previous" --image-manifest "$MANIFEST" || true + aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="production-previous" || true + aws ecr put-image --repository-name research-catalog --image-tag "production-previous" --image-manifest "$MANIFEST" || true docker push $ECR_URL - name: Update ECS service run: | - aws ecs update-service --cluster research-catalog-$APP_ENV --service research-catalog-$APP_ENV --force-new-deployment + aws ecs update-service --cluster research-catalog-production --service research-catalog-production --force-new-deployment diff --git a/.github/workflows/deploy_qa.yml b/.github/workflows/deploy_qa.yml index 2e85ce6b8..0250ba016 100644 --- a/.github/workflows/deploy_qa.yml +++ b/.github/workflows/deploy_qa.yml @@ -15,7 +15,6 @@ env: AWS_DEFAULT_REGION: us-east-1 # LOCAL_TAG_NAME: research-catalog:${{ github.ref_name }}-${{ github.run_number }} LOCAL_TAG_NAME: research-catalog:test-${{ github.run_number }} - APP_ENV: qa jobs: deploy: @@ -36,16 +35,16 @@ jobs: - name: Build and push Docker image to Amazon ECR env: - ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:$APP_ENV-latest - MANIFEST: $(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="$APP_ENV-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest') + ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:qa-latest + MANIFEST: $(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="qa-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest') run: | - docker build --build-arg NEXT_PUBLIC_APP_ENV=$APP_ENV --tag $LOCAL_TAG_NAME . + docker build --build-arg NEXT_PUBLIC_APP_ENV=qa --tag $LOCAL_TAG_NAME . docker tag $LOCAL_TAG_NAME $ECR_URL - aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="$APP_ENV-previous" || true - aws ecr put-image --repository-name research-catalog --image-tag "$APP_ENV-previous" --image-manifest "$MANIFEST" || true + aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="qa-previous" || true + aws ecr put-image --repository-name research-catalog --image-tag "qa-previous" --image-manifest "$MANIFEST" || true # docker push $ECR_URL # - name: Update ECS service # run: | - # aws ecs update-service --cluster research-catalog-$APP_ENV --service research-catalog-$APP_ENV --force-new-deployment + # aws ecs update-service --cluster research-catalog-qa --service research-catalog-qa --force-new-deployment