diff --git a/.azuredevops/pipelines/deploy.yml b/.azuredevops/pipelines/deploy.yml index 310597bc..cab4f5f1 100644 --- a/.azuredevops/pipelines/deploy.yml +++ b/.azuredevops/pipelines/deploy.yml @@ -57,3 +57,12 @@ stages: export ARM_OIDC_TOKEN="$idToken" export ARM_USE_OIDC=true make ci ${{ parameters.environment }} terraform-apply DOCKER_IMAGE_TAG=git-sha-${{ parameters.commitSHA }} PR_NUMBER=${{ parameters.prNumber }} + + - task: AzureCLI@2 + displayName: Run database setup + inputs: + azureSubscription: sc-lungcs-${{ parameters.environment }}-spoke + scriptType: bash + scriptLocation: inlineScript + addSpnToEnvironment: true + inlineScript: make ci ${{ parameters.environment }} db-setup PR_NUMBER=${{ parameters.prNumber }} diff --git a/.github/workflows/cicd-1-pull-request-closed.yaml b/.github/workflows/cicd-1-pull-request-closed.yaml index c017255e..a3aeaa18 100644 --- a/.github/workflows/cicd-1-pull-request-closed.yaml +++ b/.github/workflows/cicd-1-pull-request-closed.yaml @@ -33,13 +33,13 @@ jobs: --commit-id ${{ github.event.pull_request.head.sha }}\ --name "Delete review app"\ --org https://dev.azure.com/nhse-dtos \ - --project lung-cancer-risk-check \ + --project lung-cancer-screening \ --parameters commitSHA=${{ github.event.pull_request.head.sha }} prNumber=${{ github.event.pull_request.number }} \ --output tsv --query id) - echo "See pipeline run in Azure devops: https://dev.azure.com/nhse-dtos/lung-cancer-risk-check/_build/results?buildId=${RUN_ID}&view=results" + echo "See pipeline run in Azure devops: https://dev.azure.com/nhse-dtos/lung-cancer-screening/_build/results?buildId=${RUN_ID}&view=results" - scripts/bash/wait_ado_pipeline.sh "$RUN_ID" https://dev.azure.com/nhse-dtos lung_cancer_screening + scripts/bash/wait_ado_pipeline.sh "$RUN_ID" https://dev.azure.com/nhse-dtos lung-cancer-screening - name: Post URL to PR comments uses: marocchino/sticky-pull-request-comment@5060d4700a91de252c87eeddd2da026382d9298a diff --git a/scripts/terraform/terraform.mk b/scripts/terraform/terraform.mk index 84d882f1..5566037f 100644 --- a/scripts/terraform/terraform.mk +++ b/scripts/terraform/terraform.mk @@ -33,7 +33,7 @@ review: # Target the review infrastructure, or a review app if PR_NUMBER is used $(if ${PR_NUMBER}, $(eval export ENVIRONMENT=pr-${PR_NUMBER}), $(eval export ENVIRONMENT=review)) db-setup: - $(if ${TF_VAR_deploy_container_apps},, scripts/bash/db_run_job.sh ${ENVIRONMENT} ${PR_NUMBER}) + $(if ${TF_VAR_deploy_container_apps},, scripts/bash/run_container_app_job.sh ${ENVIRONMENT} dbm ${PR_NUMBER}) ci: # Skip manual approvals when running in CI - make ci $(eval AUTO_APPROVE=-auto-approve)