From f687f700f986ac9554f02503327b174b00a2a6a4 Mon Sep 17 00:00:00 2001 From: Mel <97147377+MelissaAutumn@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:59:07 -0700 Subject: [PATCH] Bake in the github short sha as the container's release version. (#531) * Bake in the github short sha as the container's release version. * changed github_sha syntax for consistency within the file --------- Co-authored-by: Jo --- .github/workflows/deploy-staging.yml | 3 ++- backend/deploy.dockerfile | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index a4c709b1d..9edb1a79d 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -212,11 +212,12 @@ jobs: id: build-backend env: ECR_TAG: '${{ steps.login-ecr.outputs.registry }}/${{ vars.PROJECT }}:backend-${{ github.sha }}' + RELEASE_VERSION: ${{ github.sha }} run: | # Build a docker container and # push it to ECR so that it can # be deployed to ECS. - docker build -t $ECR_TAG ./backend -f ./backend/deploy.dockerfile + docker build --build-arg "RELEASE_VERSION=$RELEASE_VERSION" -t $ECR_TAG ./backend -f ./backend/deploy.dockerfile docker push $ECR_TAG echo "image_backend=$ECR_TAG" >> $GITHUB_OUTPUT echo $ECR_TAG > ecr_tag.txt diff --git a/backend/deploy.dockerfile b/backend/deploy.dockerfile index 7a8e78be4..9865ff840 100644 --- a/backend/deploy.dockerfile +++ b/backend/deploy.dockerfile @@ -36,6 +36,8 @@ RUN pip install .'[deploy]' RUN mkdir src RUN ln -s /app/appointment src/appointment +ARG RELEASE_VERSION +ENV RELEASE_VERSION=$RELEASE_VERSION EXPOSE 5000 CMD ["/bin/sh", "./scripts/entry.sh"]