Skip to content

Commit

Permalink
Replicate production env to AKS
Browse files Browse the repository at this point in the history
  • Loading branch information
johnake committed Oct 4, 2023
1 parent 363f020 commit 30c9cae
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ jobs:
environment: ${{ matrix.environment }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}

deploy_v2_production:
name: Deploy to production_aks environment
runs-on: ubuntu-latest
continue-on-error: true
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: production_aks
url: ${{ steps.deploy_v2.outputs.environment_url }}
concurrency: deploy_production_aks
needs: [docker, deploy_v2_nonprod]

outputs:
environment_url: ${{ steps.deploy_v2.outputs.environment_url }}

steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/deploy_v2
id: deploy_v2
with:
environment: production_aks
docker_image: ${{ needs.docker.outputs.docker_image }}
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}

deploy_nonprod:
name: Deploy to ${{ matrix.environment }} environment
runs-on: ubuntu-latest
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, preprod]
environment: [dev, test, preprod, production]
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 @@ -13,6 +13,7 @@ on:
- dev
- test
- preprod
- production

env:
BACKUP_ARTIFACT_NAME: ${{ inputs.environment }}-backup
Expand Down Expand Up @@ -86,6 +87,9 @@ jobs:
preprod)
echo "ENVIRONMENT_AKS=preproduction_aks" >> $GITHUB_OUTPUT
;;
production)
echo "ENVIRONMENT_AKS=production_aks" >> $GITHUB_OUTPUT
;;
*)
echo "unknown cluster"
;;
Expand Down Expand Up @@ -133,6 +137,11 @@ jobs:
echo "cluster_name=$test_cluster_name" >> $GITHUB_ENV
echo "app_name=find-a-lost-trn-preproduction" >> $GITHUB_ENV
;;
production_aks)
echo "cluster_rg=$production_cluster_rg" >> $GITHUB_ENV
echo "cluster_name=$production_cluster_name" >> $GITHUB_ENV
echo "app_name=find-a-lost-trn-production" >> $GITHUB_ENV
;;
*)
echo "unknown cluster"
;;
Expand Down
4 changes: 3 additions & 1 deletion terraform/aks/workspace_variables/production_aks.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"app_environment": "production",
"cluster": "production",
"file_environment": "prod",
"enable_monitoring": false,
"namespace": "tra-production",
"azure_resource_prefix": "s189p01",
"config_short": "pd",
"service_short": "faltrn",
"app_key_vault": "s189p01-faltrn-pp-app-kv"
"app_key_vault": "s189p01-faltrn-pd-app-kv",
"worker_replicas": 0
}

0 comments on commit 30c9cae

Please sign in to comment.