Skip to content

Commit 5a4ea89

Browse files
Merge branch 'main' into DTOSS-7725-update-exception-flag-in-cohort-dist
2 parents de85320 + 4c5475e commit 5a4ea89

307 files changed

Lines changed: 7561 additions & 1596 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azuredevops/pipelines/acr-image-promote-dev-to-nft.yaml

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,21 @@ resources:
99
- repository: dtos-devops-templates
1010
type: github
1111
name: NHSDigital/dtos-devops-templates
12-
ref: 7dd6e83de82475570a27e172b95be8d30f488695
12+
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
1313
endpoint: NHSDigital
1414

15-
parameters:
15+
variables:
16+
- group: DEV_hub_backend_remote_state
1617
- name: destEnvironmentShortName
17-
displayName: Destination Environment Short Name
18-
type: string
19-
values:
20-
- dev
21-
default: dev
22-
18+
value: nft
2319
- name: sourceRegistry
24-
displayName: Source Container Registry
25-
type: string
26-
values:
27-
- acrukshubdevcohman
28-
default: acrukshubdevcohman
29-
20+
value: acrukshubdevcohman
3021
- name: selectImageTag
31-
displayName: Select Image Tag
32-
type: string
33-
values:
34-
- development
35-
default: development
36-
22+
value: development
3723
- name: destRegistry
38-
displayName: Destination Container Registry
39-
type: string
40-
values:
41-
- acrukshubdevcohman
42-
default: acrukshubdevcohman
43-
24+
value: acrukshubdevcohman
4425
- name: addImageTag
45-
displayName: Target Image Tag
46-
type: string
47-
values:
48-
- nft
49-
default: nft
50-
51-
variables:
52-
- group: DEV_hub_backend_remote_state
26+
value: nft
5327

5428
stages:
5529
- stage: db_changes_stage
@@ -63,7 +37,7 @@ stages:
6337
- checkout: self
6438
- template: .azuredevops/templates/steps/apply-database-changes.yaml@dtos-devops-templates
6539
parameters:
66-
serviceConnection: sc-cohort-manager-dev
40+
serviceConnection: sc-cohort-manager-nft
6741

6842
- stage: re_tag_stage
6943
displayName: ACR re-tag
@@ -73,44 +47,50 @@ stages:
7347
name: private-pool-prod-uks
7448
displayName: Update/copy Docker images with new tag
7549
variables:
76-
SRC_REGISTRY: ${{ parameters.sourceRegistry }}
77-
DEST_REGISTRY: ${{ parameters.destRegistry }}
78-
SELECT_IMAGE_TAG: ${{ parameters.selectImageTag }}
79-
ADD_IMAGE_TAG: ${{ parameters.addImageTag }}
50+
SRC_REGISTRY: $(sourceRegistry)
51+
DEST_REGISTRY: $(destRegistry)
52+
SELECT_IMAGE_TAG: $(selectImageTag)
53+
ADD_IMAGE_TAG: $(addImageTag)
8054
steps:
8155
- template: .azuredevops/templates/steps/acr-import-retag.yaml@dtos-devops-templates
8256
parameters:
83-
serviceConnection: sc-cohort-manager-dev
57+
serviceConnection: sc-cohort-manager-nft
8458

8559
- stage: deploy_image_stage
8660
displayName: Deploy images
8761
jobs:
8862
- job: deploy_images
8963
pool:
90-
name: private-pool-prod-uks
64+
name: private-pool-dev-uks
9165
displayName: Deploy Docker images to function apps
9266
variables:
93-
DEST_REGISTRY: ${{ parameters.destRegistry }}
94-
ADD_IMAGE_TAG: ${{ parameters.addImageTag }}
95-
FUNCTION_NAME_PREFIX: ${{ parameters.destEnvironmentShortName }}-uks
96-
FUNCTION_RESOURCE_GROUP: rg-cohort-manager-${{ parameters.destEnvironmentShortName }}-uks
67+
DEST_REGISTRY: $(destRegistry)
68+
ADD_IMAGE_TAG: $(addImageTag)
69+
FUNCTION_NAME_PREFIX: $(destEnvironmentShortName)-uks
70+
FUNCTION_RESOURCE_GROUP: rg-cohort-manager-$(destEnvironmentShortName)-uks
9771
PROJECT_NAME: cohort-manager
9872
steps:
9973
- template: .azuredevops/templates/steps/deploy-images-from-acr.yaml@dtos-devops-templates
10074
parameters:
101-
serviceConnection: sc-cohort-manager-dev
75+
serviceConnection: sc-cohort-manager-nft
10276

10377
- stage: post_deployment_tests_stage
10478
displayName: Post-deployment tests
79+
variables:
80+
- group: NFT_automation_testing_pipeline
10581
jobs:
10682
- job: post_deployment_tests
107-
pool:
108-
name: private-pool-prod-uks
10983
displayName: Run post-deployment tests
84+
pool:
85+
name: private-pool-dev-uks
11086
variables:
111-
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
87+
AppSettings.ConnectionStrings.DtOsDatabaseConnectionString: $(DTOS_DATABASE_CONNECTION_STRING)
88+
AppSettings.CloudFileStorageConnectionString: $(CAASFOLDER_STORAGE_CONNECTION_STRING)
89+
AppSettings.ManagedIdentityClientId: $(MANAGED_IDENTITY_CLIENT_ID)
90+
AppSettings.IsCloudEnvironment: $(Is_CloudEnvironment)
11291
steps:
113-
- checkout: self
114-
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
115-
parameters:
116-
serviceConnection: sc-cohort-manager-dev
92+
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
93+
parameters:
94+
serviceConnection: sc-cohort-manager-nft
95+
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
96+
testProjectName: 'NHS.CohortManager.SmokeTests'

.azuredevops/pipelines/acr-image-promote-nft-to-integration.yaml

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,21 @@ resources:
99
- repository: dtos-devops-templates
1010
type: github
1111
name: NHSDigital/dtos-devops-templates
12-
ref: 7dd6e83de82475570a27e172b95be8d30f488695
12+
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
1313
endpoint: NHSDigital
1414

15-
parameters:
15+
variables:
16+
- group: DEV_hub_backend_remote_state
1617
- name: destEnvironmentShortName
17-
displayName: Destination Environment Short Name
18-
type: string
19-
values:
20-
- int
21-
default: int
22-
18+
value: int
2319
- name: sourceRegistry
24-
displayName: Source Container Registry
25-
type: string
26-
values:
27-
- acrukshubdevcohman
28-
default: acrukshubdevcohman
29-
20+
value: acrukshubdevcohman
3021
- name: selectImageTag
31-
displayName: Select Image Tag
32-
type: string
33-
values:
34-
- nft
35-
default: nft
36-
22+
value: nft
3723
- name: destRegistry
38-
displayName: Destination Container Registry
39-
type: string
40-
values:
41-
- acrukshubdevcohman
42-
default: acrukshubdevcohman
43-
24+
value: acrukshubdevcohman
4425
- name: addImageTag
45-
displayName: Target Image Tag
46-
type: string
47-
values:
48-
- integration
49-
default: integration
50-
51-
variables:
52-
- group: DEV_hub_backend_remote_state
26+
value: integration
5327

5428
stages:
5529
- stage: db_changes_stage
@@ -63,7 +37,7 @@ stages:
6337
- checkout: self
6438
- template: .azuredevops/templates/steps/apply-database-changes.yaml@dtos-devops-templates
6539
parameters:
66-
serviceConnection: sc-cohort-manager-dev
40+
serviceConnection: sc-cohort-manager-int
6741

6842
- stage: re_tag_stage
6943
displayName: ACR re-tag
@@ -73,44 +47,50 @@ stages:
7347
name: private-pool-prod-uks
7448
displayName: Update/copy Docker images with new tag
7549
variables:
76-
SRC_REGISTRY: ${{ parameters.sourceRegistry }}
77-
DEST_REGISTRY: ${{ parameters.destRegistry }}
78-
SELECT_IMAGE_TAG: ${{ parameters.selectImageTag }}
79-
ADD_IMAGE_TAG: ${{ parameters.addImageTag }}
50+
SRC_REGISTRY: $(sourceRegistry)
51+
DEST_REGISTRY: $(destRegistry)
52+
SELECT_IMAGE_TAG: $(selectImageTag)
53+
ADD_IMAGE_TAG: $(addImageTag)
8054
steps:
8155
- template: .azuredevops/templates/steps/acr-import-retag.yaml@dtos-devops-templates
8256
parameters:
83-
serviceConnection: sc-cohort-manager-dev
57+
serviceConnection: sc-cohort-manager-int
8458

8559
- stage: deploy_image_stage
8660
displayName: Deploy images
8761
jobs:
8862
- job: deploy_images
8963
pool:
90-
name: private-pool-prod-uks
64+
name: private-pool-dev-uks
9165
displayName: Deploy Docker images to function apps
9266
variables:
93-
DEST_REGISTRY: ${{ parameters.destRegistry }}
94-
ADD_IMAGE_TAG: ${{ parameters.addImageTag }}
95-
FUNCTION_NAME_PREFIX: ${{ parameters.destEnvironmentShortName }}-uks
96-
FUNCTION_RESOURCE_GROUP: rg-cohort-manager-${{ parameters.destEnvironmentShortName }}-uks
67+
DEST_REGISTRY: $(destRegistry)
68+
ADD_IMAGE_TAG: $(addImageTag)
69+
FUNCTION_NAME_PREFIX: $(destEnvironmentShortName)-uks
70+
FUNCTION_RESOURCE_GROUP: rg-cohort-manager-$(destEnvironmentShortName)-uks
9771
PROJECT_NAME: cohort-manager
9872
steps:
9973
- template: .azuredevops/templates/steps/deploy-images-from-acr.yaml@dtos-devops-templates
10074
parameters:
101-
serviceConnection: sc-cohort-manager-dev
75+
serviceConnection: sc-cohort-manager-int
10276

10377
- stage: post_deployment_tests_stage
10478
displayName: Post-deployment tests
79+
variables:
80+
- group: INT_automation_testing_pipeline
10581
jobs:
10682
- job: post_deployment_tests
107-
pool:
108-
name: private-pool-prod-uks
10983
displayName: Run post-deployment tests
84+
pool:
85+
name: private-pool-dev-uks
11086
variables:
111-
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
87+
AppSettings.ConnectionStrings.DtOsDatabaseConnectionString: $(DTOS_DATABASE_CONNECTION_STRING)
88+
AppSettings.CloudFileStorageConnectionString: $(CAASFOLDER_STORAGE_CONNECTION_STRING)
89+
AppSettings.ManagedIdentityClientId: $(MANAGED_IDENTITY_CLIENT_ID)
90+
AppSettings.IsCloudEnvironment: $(Is_CloudEnvironment)
11291
steps:
113-
- checkout: self
114-
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
115-
parameters:
116-
serviceConnection: sc-cohort-manager-dev
92+
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
93+
parameters:
94+
serviceConnection: sc-cohort-manager-int
95+
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
96+
testProjectName: 'NHS.CohortManager.SmokeTests'
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
3+
name: $(Build.SourceBranchName)-$(Date:yyyyMMdd)_$(Rev:r)
4+
trigger: none
5+
pr: none
6+
7+
resources:
8+
repositories:
9+
- repository: dtos-devops-templates
10+
type: github
11+
name: NHSDigital/dtos-devops-templates
12+
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
13+
endpoint: NHSDigital
14+
15+
variables:
16+
- group: DEV_hub_backend_remote_state
17+
- name: destEnvironmentShortName
18+
value: dev
19+
20+
stages:
21+
- stage: db_changes_stage
22+
displayName: Database changes
23+
jobs:
24+
- job: db_changes
25+
pool:
26+
name: private-pool-dev-uks
27+
displayName: Apply database changes
28+
steps:
29+
- checkout: self
30+
- template: .azuredevops/templates/steps/apply-database-changes.yaml@dtos-devops-templates
31+
parameters:
32+
serviceConnection: sc-cohort-manager-dev
33+
34+
- stage: deploy_image_stage
35+
displayName: Deploy images
36+
jobs:
37+
- job: deploy_images
38+
pool:
39+
name: private-pool-dev-uks
40+
displayName: Deploy Docker images to function apps
41+
variables:
42+
DEST_REGISTRY: $(destRegistry)
43+
ADD_IMAGE_TAG: $(addImageTag)
44+
FUNCTION_NAME_PREFIX: $(destEnvironmentShortName)-uks
45+
FUNCTION_RESOURCE_GROUP: rg-cohort-manager-$(destEnvironmentShortName)-uks
46+
PROJECT_NAME: cohort-manager
47+
steps:
48+
- template: .azuredevops/templates/steps/deploy-images-from-acr.yaml@dtos-devops-templates
49+
parameters:
50+
serviceConnection: sc-cohort-manager-dev
51+
52+
- stage: post_deployment_tests_stage
53+
displayName: Post-deployment tests
54+
variables:
55+
- group: DEV_automation_testing_pipeline
56+
jobs:
57+
- job: post_deployment_tests
58+
displayName: Run post-deployment tests
59+
pool:
60+
name: private-pool-dev-uks
61+
variables:
62+
AppSettings.ConnectionStrings.DtOsDatabaseConnectionString: $(DTOS_DATABASE_CONNECTION_STRING)
63+
AppSettings.CloudFileStorageConnectionString: $(CAASFOLDER_STORAGE_CONNECTION_STRING)
64+
AppSettings.ManagedIdentityClientId: $(MANAGED_IDENTITY_CLIENT_ID)
65+
AppSettings.IsCloudEnvironment: $(Is_CloudEnvironment)
66+
steps:
67+
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
68+
parameters:
69+
serviceConnection: sc-cohort-manager-dev
70+
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
71+
testProjectName: 'NHS.CohortManager.SmokeTests'

.azuredevops/pipelines/post-deployment-tests-dev.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resources:
99
- repository: dtos-devops-templates
1010
type: github
1111
name: NHSDigital/dtos-devops-templates
12-
ref: 0a1ae809e2b5f41a1974c5490595e08f591fb8c7
12+
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
1313
endpoint: NHSDigital
1414

1515
variables:
@@ -32,8 +32,8 @@ stages:
3232
value: ${{ parameters.destEnvironmentShortName }}
3333

3434
jobs:
35-
- job: post_deployment_tests
36-
displayName: Run post-deployment tests
35+
- job: post_deployment_tests_smoke
36+
displayName: Run post-deployment smoke tests
3737
pool:
3838
name: private-pool-dev-uks
3939
variables:
@@ -45,3 +45,6 @@ stages:
4545
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
4646
parameters:
4747
serviceConnection: sc-cohort-manager-dev
48+
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
49+
testProjectName: 'NHS.CohortManager.SmokeTests'
50+

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,14 @@ jobs:
102102
build-image-stage: # Recommended maximum execution time is 3 minutes
103103
name: "Image build stage"
104104
needs: [metadata, commit-stage, test-stage]
105-
uses: ./.github/workflows/stage-3-build-images.yaml
106-
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
105+
uses: NHSDigital/dtos-devops-templates/.github/workflows/stage-3-build-images.yaml@main
106+
if: needs.metadata.outputs.does_pull_request_exist == 'true' || github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
107107
with:
108-
environment_tag: "${{ needs.metadata.outputs.environment_tag }}"
108+
docker_compose_file: application/CohortManager/compose.core.yaml,application/CohortManager/compose.cohort-distribution.yaml
109+
excluded_containers_csv_list: azurite,azurite-setup,sql-edge,db-setup
110+
environment_tag: ${{ needs.metadata.outputs.environment_tag }}
111+
function_app_source_code_path: application/CohortManager/src
112+
project_name: cohort-manager
109113
secrets: inherit
110114
acceptance-stage: # Recommended maximum execution time is 10 minutes
111115
name: "Acceptance stage"

0 commit comments

Comments
 (0)