Skip to content

Commit

Permalink
Replicate preproduction to AKS
Browse files Browse the repository at this point in the history
  • Loading branch information
johnake committed Sep 28, 2023
1 parent 23bf44d commit 52eacbc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
44 changes: 13 additions & 31 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,54 +87,36 @@ jobs:
message: |
AKS review app deployed to ${{ steps.deploy_v2.outputs.environment_url }}
deploy_v2_dev:
name: Deploy to development_aks environment
concurrency: deploy_v2_development
needs: [docker]
deploy_v2_nonprod:
name: Deploy to ${{ matrix.environment }} environment
runs-on: ubuntu-latest
continue-on-error: true
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: development_aks

steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/deploy_v2
id: deploy_v2
with:
environment: development_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: development_aks
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}

deploy_v2_test:
name: Deploy to test_aks environment
concurrency: deploy_v2_test
concurrency: deploy_${{ matrix.environment }}
needs: [docker]
runs-on: ubuntu-latest
continue-on-error: true
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
strategy:
max-parallel: 1
matrix:
environment: [development_aks, test_aks, preproduction_aks]
environment:
name: test_aks
name: ${{ matrix.environment }}
url: ${{ steps.deploy.outputs.environment_url }}
outputs:
environment_url: ${{ steps.deploy.outputs.environment_url }}

steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/deploy_v2
id: deploy_v2
with:
environment: test_aks
environment: ${{ matrix.environment }}
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
environment: ${{ matrix.environment }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}

deploy_nonprod:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/database-copy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Restore DB
strategy:
matrix:
environment: [dev, test]
environment: [dev, test, preprod]
max-parallel: 1
uses: ./.github/workflows/restore-paas-db-to-aks.yml
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/restore-paas-db-to-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
options:
- dev
- test
- preprod

env:
BACKUP_ARTIFACT_NAME: ${{ inputs.environment }}-backup
Expand Down Expand Up @@ -82,6 +83,9 @@ jobs:
test)
echo "ENVIRONMENT_AKS=test_aks" >> $GITHUB_OUTPUT
;;
preprod)
echo "ENVIRONMENT_AKS=preproduction_aks" >> $GITHUB_OUTPUT
;;
*)
echo "unknown cluster"
;;
Expand Down Expand Up @@ -124,6 +128,11 @@ jobs:
echo "cluster_name=$test_cluster_name" >> $GITHUB_ENV
echo "app_name=find-a-lost-trn-test" >> $GITHUB_ENV
;;
preproduction_aks)
echo "cluster_rg=$test_cluster_rg" >> $GITHUB_ENV
echo "cluster_name=$test_cluster_name" >> $GITHUB_ENV
echo "app_name=find-a-lost-trn-preproduction" >> $GITHUB_ENV
;;
*)
echo "unknown cluster"
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"app_environment": "preproduction",
"cluster": "test",
"enable_monitoring": false,
"file_environment": "preprod",
"namespace": "tra-test",
"azure_resource_prefix": "s189t01",
"config_short": "pp",
Expand Down

0 comments on commit 52eacbc

Please sign in to comment.