Skip to content

Commit cc6bb8e

Browse files
authored
Merge pull request #331 from NHSDigital/PPHA-674-Auto-trigger-db-population
Ppha 674 auto trigger db population
2 parents 1b777b2 + ed87622 commit cc6bb8e

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

.azuredevops/pipelines/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ stages:
5757
export ARM_OIDC_TOKEN="$idToken"
5858
export ARM_USE_OIDC=true
5959
make ci ${{ parameters.environment }} terraform-apply DOCKER_IMAGE_TAG=git-sha-${{ parameters.commitSHA }} PR_NUMBER=${{ parameters.prNumber }}
60+
61+
- task: AzureCLI@2
62+
displayName: Run database setup
63+
inputs:
64+
azureSubscription: sc-lungcs-${{ parameters.environment }}-spoke
65+
scriptType: bash
66+
scriptLocation: inlineScript
67+
addSpnToEnvironment: true
68+
inlineScript: make ci ${{ parameters.environment }} db-setup PR_NUMBER=${{ parameters.prNumber }}

.github/workflows/cicd-1-pull-request-closed.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ jobs:
3333
--commit-id ${{ github.event.pull_request.head.sha }}\
3434
--name "Delete review app"\
3535
--org https://dev.azure.com/nhse-dtos \
36-
--project lung-cancer-risk-check \
36+
--project lung-cancer-screening \
3737
--parameters commitSHA=${{ github.event.pull_request.head.sha }} prNumber=${{ github.event.pull_request.number }} \
3838
--output tsv --query id)
3939
40-
echo "See pipeline run in Azure devops: https://dev.azure.com/nhse-dtos/lung-cancer-risk-check/_build/results?buildId=${RUN_ID}&view=results"
40+
echo "See pipeline run in Azure devops: https://dev.azure.com/nhse-dtos/lung-cancer-screening/_build/results?buildId=${RUN_ID}&view=results"
4141
42-
scripts/bash/wait_ado_pipeline.sh "$RUN_ID" https://dev.azure.com/nhse-dtos lung_cancer_screening
42+
scripts/bash/wait_ado_pipeline.sh "$RUN_ID" https://dev.azure.com/nhse-dtos lung-cancer-screening
4343
4444
- name: Post URL to PR comments
4545
uses: marocchino/sticky-pull-request-comment@5060d4700a91de252c87eeddd2da026382d9298a

scripts/terraform/terraform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ review: # Target the review infrastructure, or a review app if PR_NUMBER is used
3333
$(if ${PR_NUMBER}, $(eval export ENVIRONMENT=pr-${PR_NUMBER}), $(eval export ENVIRONMENT=review))
3434

3535
db-setup:
36-
$(if ${TF_VAR_deploy_container_apps},, scripts/bash/db_run_job.sh ${ENVIRONMENT} ${PR_NUMBER})
36+
$(if ${TF_VAR_deploy_container_apps},, scripts/bash/run_container_app_job.sh ${ENVIRONMENT} dbm ${PR_NUMBER})
3737

3838
ci: # Skip manual approvals when running in CI - make ci <env> <action>
3939
$(eval AUTO_APPROVE=-auto-approve)

0 commit comments

Comments
 (0)