From 769445fa89027dfc5083fb9b355ced64fe446bb1 Mon Sep 17 00:00:00 2001 From: John Ake Date: Wed, 20 Sep 2023 15:29:31 +0400 Subject: [PATCH] Replicate test environment to AKS --- .github/workflows/build-and-deploy.yml | 25 +++++++++++++++++++ Makefile | 3 +-- .../workspace_variables/test_aks.tfvars.json | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 473a89e4..359b3b40 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -112,6 +112,31 @@ jobs: environment: development_aks azure_credentials: ${{ secrets.AZURE_CREDENTIALS }} + deploy_v2_test: + name: Deploy to test_aks environment + concurrency: deploy_v2_test + needs: [docker] + runs-on: ubuntu-latest + continue-on-error: true + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + environment: + name: test_aks + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/workflows/actions/deploy_v2 + id: deploy_v2 + with: + environment: test_aks + docker_image: ${{ needs.docker.outputs.docker_image }} + azure-credentials: ${{ secrets.AZURE_CREDENTIALS }} + arm-access-key: ${{ secrets.ARM_ACCESS_KEY }} + - uses: ./.github/workflows/actions/smoke-test-v2 + id: smoke-test + with: + environment: test_aks + azure_credentials: ${{ secrets.AZURE_CREDENTIALS }} + deploy_nonprod: name: Deploy to ${{ matrix.environment }} environment runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 4a0eb242..a243759b 100644 --- a/Makefile +++ b/Makefile @@ -203,8 +203,7 @@ terraform-init-aks: bin/terrafile [[ "${SP_AUTH}" != "true" ]] && az account set -s $(AZURE_SUBSCRIPTION) || true ./bin/terrafile -p terraform/aks/vendor/modules -f terraform/aks/workspace_variables/$(CONFIG)_Terrafile terraform -chdir=terraform/aks init -backend-config workspace_variables/$(CONFIG).backend.tfvars $(backend_config) -upgrade -reconfigure - $(if $(IMAGE_TAG), , $(eval export IMAGE_TAG=2ad42e8958a4d63ed295a58a0847430705725ba8)) - $(eval export TF_VAR_paas_app_docker_image=ghcr.io/dfe-digital/find-a-lost-trn:$(IMAGE_TAG)) + $(if $(DOCKER_IMAGE), $(eval export TF_VAR_paas_app_docker_image=$(DOCKER_IMAGE)), $(error Missing environment variable "DOCKER_IMAGE")) terraform-plan-aks: terraform-init-aks terraform -chdir=terraform/aks plan -var-file workspace_variables/$(CONFIG).tfvars.json diff --git a/terraform/aks/workspace_variables/test_aks.tfvars.json b/terraform/aks/workspace_variables/test_aks.tfvars.json index 787a8aa2..f637c660 100644 --- a/terraform/aks/workspace_variables/test_aks.tfvars.json +++ b/terraform/aks/workspace_variables/test_aks.tfvars.json @@ -1,6 +1,7 @@ { "app_environment": "test", "cluster": "test", + "file_environment": "test", "enable_monitoring": false, "namespace": "tra-test", "azure_resource_prefix": "s189t01",