From 408befd4520c2787de84d304abf52c487d65355e Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Wed, 9 Feb 2022 14:48:06 -0500 Subject: [PATCH 1/8] test change on my branch --- .github/workflows/deploy-template.yml | 5 +++-- .github/workflows/deploy.yml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 27c75a73..45d64d79 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -86,10 +86,11 @@ jobs: cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}} # Update ecr image envs=( ${{ needs.prepare-values.outputs.environments }} ) + image_name = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}" 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 + 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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5b6b2fca..d7caa9f2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,12 +3,12 @@ name: Release and Update Manifests on: push: branches: - - master + - lhattamer-manifests-yml-update workflow_dispatch: jobs: deploy: - uses: department-of-veterans-affairs/platform-console-api/.github/workflows/deploy-template.yml@master + uses: department-of-veterans-affairs/platform-console-api/.github/workflows/deploy-template.yml@lhattamer-manifests-yml-update with: ecr_repository: 'platform-console' manifests_directory: 'vsp-tools-backend/platform-console-api' From 8a85c75d3400dfb0f0ae14bc7dbce6e69e9fb428 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Wed, 9 Feb 2022 14:52:58 -0500 Subject: [PATCH 2/8] debug syntax error --- .github/workflows/deploy-template.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 45d64d79..7cca003b 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -86,11 +86,10 @@ jobs: cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}} # Update ecr image envs=( ${{ needs.prepare-values.outputs.environments }} ) - image_name = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}" 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 = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"' $env/deployment.yml + yq e -i '.spec.template.spec.initContainers.[0].image = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"' $env/deployment.yml done git diff From 0bc44cbc4bd7aaf7bb99b04c60d3cbd6a46ae89f Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Wed, 9 Feb 2022 15:03:19 -0500 Subject: [PATCH 3/8] test --- .github/workflows/deploy-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 7cca003b..84d1f7d1 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -85,10 +85,11 @@ jobs: run: | cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}} # Update ecr image + image = "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 + yq e -i '.spec.template.spec.containers.[0].image = ${image}' $env/deployment.yml yq e -i '.spec.template.spec.initContainers.[0].image = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"' $env/deployment.yml done git diff From 36469f9597cdf6398eaa392c50f54ab33f6d4990 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Wed, 9 Feb 2022 15:07:08 -0500 Subject: [PATCH 4/8] spaces --- .github/workflows/deploy-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 84d1f7d1..ff1fd49b 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -85,12 +85,12 @@ jobs: run: | cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}} # Update ecr image - image = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}" + 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}' $env/deployment.yml - yq e -i '.spec.template.spec.initContainers.[0].image = "008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/dsva/${{inputs.ecr_repository}}:${{inputs.ecr_repository}}-${{ github.sha }}"' $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 git diff From b788088898eb47d7e7b4e40a74b80f8065457351 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Wed, 9 Feb 2022 16:09:59 -0500 Subject: [PATCH 5/8] put back to master branch --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d7caa9f2..5b6b2fca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,12 +3,12 @@ name: Release and Update Manifests on: push: branches: - - lhattamer-manifests-yml-update + - master workflow_dispatch: jobs: deploy: - uses: department-of-veterans-affairs/platform-console-api/.github/workflows/deploy-template.yml@lhattamer-manifests-yml-update + uses: department-of-veterans-affairs/platform-console-api/.github/workflows/deploy-template.yml@master with: ecr_repository: 'platform-console' manifests_directory: 'vsp-tools-backend/platform-console-api' From e0be9d48c51fc483e2961f46fd2daf6cf38c4780 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Thu, 10 Feb 2022 09:50:08 -0500 Subject: [PATCH 6/8] update readme --- docs/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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: From ed6e7dc8c7eeb60c0d94d7e9eec109f89fef1a24 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Fri, 11 Feb 2022 14:01:47 -0500 Subject: [PATCH 7/8] add cleanup from tuple --- .github/workflows/deploy-template.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index ff1fd49b..883b836a 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,15 +84,13 @@ 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[*]}; + for env in ${envs[*]}; do 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' From 97757f33a90ad9143e0d9631435d38e7f9d80c62 Mon Sep 17 00:00:00 2001 From: Lindsey Hattamer Date: Mon, 14 Feb 2022 11:34:40 -0500 Subject: [PATCH 8/8] remove dup do --- .github/workflows/deploy-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 883b836a..9ebb7453 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -87,7 +87,6 @@ jobs: 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 - 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