Skip to content

Commit

Permalink
Add dv and pt review environments
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Dec 20, 2024
1 parent 6e6a95c commit a6b651b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/actions/deploy-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ inputs:
azure-tenant-id:
description: Azure tenant ID
required: true
dev-cluster:
description: Development cluster name (Optional)
required: false

runs:
using: composite
Expand All @@ -43,6 +46,7 @@ runs:
env:
DOCKER_IMAGE_TAG: ${{ inputs.docker-image }}
PR_NUMBER: ${{ inputs.pull-request-number }}
CLUSTER: ${{ inputs.dev-cluster }}

- name: Extract Terraform outputs
shell: bash
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ on:
- review
- staging
- sandbox
- dv
- dv_review
sha:
description: Commit sha to be deployed
required: true
pr_number:
description: PR number
pr-number:
description: PR number for review apps (Optional)
required: false
dev-cluster:
description: Development cluster name (Optional)
required: false

jobs:
Expand All @@ -28,14 +31,19 @@ jobs:
name: ${{ github.event.inputs.environment }}
concurrency: deploy_all
runs-on: ubuntu-latest
permissions:
pull-requests: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}

- name: Fetch secrets from key vault
if: ${{ github.event.inputs.environment != 'review' }}
Expand All @@ -52,10 +60,13 @@ jobs:
with:
environment: ${{ github.event.inputs.environment }}
docker-image: ${{ github.event.inputs.sha }}
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
pull-request-number: ${{ github.event.inputs.pr_number }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
pull-request-number: ${{ github.event.inputs.pr-number }}
dev-cluster: ${{ github.event.inputs.dev-cluster }}

- name: Post comment to Pull Request ${{ github.event.inputs.pr_number }}
- name: Post comment to Pull Request ${{ github.event.inputs.pr-number }}
if: ${{ github.event.inputs.environment == 'review' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
Expand All @@ -65,8 +76,8 @@ jobs:
| App | URL |
| ----------------- | ---------------------------------------------------------------------------------------- |
| Track & Pay | <https://track-and-pay-${{ github.event.inputs.pr_number }}.test.teacherservices.cloud> |
| School Placements | <https://manage-school-placements-${{ github.event.inputs.pr_number }}.test.teacherservices.cloud> |
| Track & Pay | <https://track-and-pay-${{ github.event.inputs.pr-number }}.test.teacherservices.cloud> |
| School Placements | <https://manage-school-placements-${{ github.event.inputs.pr-number }}.test.teacherservices.cloud> |
- name: Slack Notification
if: ${{ failure() && github.event.inputs.environment != 'review' }}
Expand Down
2 changes: 1 addition & 1 deletion global_config/dv_review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ CONFIG_SHORT=rv
AZURE_SUBSCRIPTION=s189-teacher-services-cloud-development
AZURE_RESOURCE_PREFIX=s189d01
KV_PURGE_PROTECTION=false
TERRAFORM_MODULES_TAG=main
TERRAFORM_MODULES_TAG=oidc-ga
1 change: 1 addition & 0 deletions global_config/production.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CONFIG=production
ENVIRONMENT=production
CONFIG_SHORT=pd
AZURE_SUBSCRIPTION=s189-teacher-services-cloud-production
AZURE_RESOURCE_PREFIX=s189p01
Expand Down
5 changes: 5 additions & 0 deletions terraform/application/config/pt_review.tfvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"namespace": "development",
"deploy_azure_backing_services": false,
"enable_postgres_ssl": false
}
11 changes: 11 additions & 0 deletions terraform/application/config/pt_review_app_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
HOSTING_ENV: review

# API integrations
GIAS_CSV_BASE_URL: https://ea-edubase-api-prod.azurewebsites.net/edubase/downloads/public
PUBLISH_BASE_URL: https://qa.api.publish-teacher-training-courses.service.gov.uk
TEACHING_RECORD_BASE_URL: https://preprod.teacher-qualifications-api.education.gov.uk
TEACHING_RECORD_API_MINOR_VERSION: 20240416

# User authentication
SIGN_IN_METHOD: persona

0 comments on commit a6b651b

Please sign in to comment.