From 17177ebb021a4a569bdcd0276174709fc8cca51b Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Tue, 15 Feb 2022 11:50:07 -0500 Subject: [PATCH] use env var --- .github/workflows/deploy-template.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 9ebb7453..213eb7e0 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -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: @@ -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