Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
fix: use env var for image_name
Browse files Browse the repository at this point in the history
Update ECR image name to be env var
  • Loading branch information
LindseySaari authored Feb 15, 2022
2 parents 1362b98 + 17177eb commit 9c1ca46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/deploy-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
required: true
aws_secret_access_key: #${{ secrets.AWS_SECRET_ACCESS_KEY }}
required: true
env:
IMAGE_NAME: "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"

jobs:
prepare-values:
Expand Down Expand Up @@ -84,11 +86,10 @@ jobs:
ECR_REPOSITORY: dsva/${{inputs.ecr_repository}}
run: |
cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}}
image_name = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"
envs=( ${{ needs.prepare-values.outputs.environments }} )
for env in ${envs[*]}; do
yq e -i '.spec.template.spec.containers.[0].image = ${image_name}' $env/deployment.yml
yq e -i '.spec.template.spec.initContainers.[0].image = ${image_name}' $env/deployment.yml
yq e -i '.spec.template.spec.containers.[0].image = ${IMAGE_NAME}' $env/deployment.yml
yq e -i '.spec.template.spec.initContainers.[0].image = ${IMAGE_NAME}' $env/deployment.yml
done
- name: Add and Commit file
Expand Down

0 comments on commit 9c1ca46

Please sign in to comment.