diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 27c75a73..9ebb7453 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -38,6 +38,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -62,7 +63,6 @@ jobs: GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} - name: Install yq if needed - if: steps.semantic.outputs.new_release_published == 'true' run: | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64 sudo add-apt-repository ppa:rmescandon/yq @@ -84,14 +84,12 @@ jobs: ECR_REPOSITORY: dsva/${{inputs.ecr_repository}} run: | cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}} - # Update ecr image + 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 = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"' $env/deployment.yml + 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 done - git diff - name: Add and Commit file if: steps.semantic.outputs.new_release_published == 'true' diff --git a/docs/README.md b/docs/README.md index 92e49b1a..7dd577f2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -33,6 +33,14 @@ This repository uses semantic releases triggered via Github Actions. When commit 4. perf: remove some change ``` +## Migrations + +### Schema migrations: +All schema migrations are run automatically upon a successful semantic release and deploy. The initContainers configuration in the platform-console-api k8s deployment spec will start and execute migrations before the other containers in the pod start. + +### Data Migrations: +All data migrations will need to be run via a manual process. + ## Running tests To run all tests, run: