diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 359b3b40..b6b21fc9 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -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: diff --git a/.github/workflows/database-copy.yml b/.github/workflows/database-copy.yml index 3954bef8..f5c0eea9 100644 --- a/.github/workflows/database-copy.yml +++ b/.github/workflows/database-copy.yml @@ -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: diff --git a/.github/workflows/restore-paas-db-to-aks.yml b/.github/workflows/restore-paas-db-to-aks.yml index f5dccbd7..3a69c2a1 100644 --- a/.github/workflows/restore-paas-db-to-aks.yml +++ b/.github/workflows/restore-paas-db-to-aks.yml @@ -12,6 +12,7 @@ on: options: - dev - test + - preprod env: BACKUP_ARTIFACT_NAME: ${{ inputs.environment }}-backup @@ -82,6 +83,9 @@ jobs: test) echo "ENVIRONMENT_AKS=test_aks" >> $GITHUB_OUTPUT ;; + preprod) + echo "ENVIRONMENT_AKS=preproduction_aks" >> $GITHUB_OUTPUT + ;; *) echo "unknown cluster" ;; @@ -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" ;; diff --git a/terraform/aks/workspace_variables/preproduction_aks.tfvars.json b/terraform/aks/workspace_variables/preproduction_aks.tfvars.json index 1f066b1f..072b945e 100644 --- a/terraform/aks/workspace_variables/preproduction_aks.tfvars.json +++ b/terraform/aks/workspace_variables/preproduction_aks.tfvars.json @@ -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",