Skip to content

Commit

Permalink
Replicate test environment to AKS
Browse files Browse the repository at this point in the history
  • Loading branch information
johnake committed Sep 22, 2023
1 parent 35bb835 commit 769445f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions terraform/aks/workspace_variables/test_aks.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"app_environment": "test",
"cluster": "test",
"file_environment": "test",
"enable_monitoring": false,
"namespace": "tra-test",
"azure_resource_prefix": "s189t01",
Expand Down

0 comments on commit 769445f

Please sign in to comment.