@@ -7,6 +7,14 @@ resources:
77 name : sb-mock-register
88 ref : develop
99
10+ schedules :
11+ - cron : ' 0 3 * * 0'
12+ displayName : ' Run at 3:00 AM every Sunday (UTC)'
13+ always : true
14+ branches :
15+ include :
16+ - develop
17+
1018trigger :
1119 - develop
1220 - main
@@ -15,6 +23,9 @@ trigger:
1523pool :
1624 vmImage : ubuntu-latest
1725
26+ variables :
27+ - group : artifacts
28+
1829steps :
1930
2031 # ##################################################################################################
@@ -28,6 +39,26 @@ steps:
2839 # Build images
2940 # ##################################################################################################
3041
42+ # Authenticate to the Azure DevOps artifacts feed. The VSS_NUGET_ACCESSTOKEN environment variable is set from this task.
43+ - task : NuGetAuthenticate@1
44+ displayName : ' Authenticate to NuGet'
45+
46+ # Build getdatarecipients
47+ - task : Bash@3
48+ displayName : Build getdatarecipients image
49+ inputs :
50+ targetType : inline
51+ script : |
52+ docker build $(Build.SourcesDirectory)/cdr-auth-server/Source -f $(Build.SourcesDirectory)/cdr-auth-server/Source/Dockerfile.get-data-recipients -t getdatarecipients:latest --build-arg FEED_ACCESSTOKEN=$(VSS_NUGET_ACCESSTOKEN) --build-arg FEED_URI=$(azdo_artifact_feed_uri)
53+
54+ # Build getdatarecipients-integration-tests
55+ - task : Bash@3
56+ displayName : Build getdatarecipients-integration-tests image
57+ inputs :
58+ targetType : inline
59+ script : |
60+ docker build $(Build.SourcesDirectory)/cdr-auth-server/Source -f $(Build.SourcesDirectory)/cdr-auth-server/Source/Dockerfile.get-data-recipients.integration-tests -t getdatarecipients-integration-tests:latest --build-arg FEED_ACCESSTOKEN=$(VSS_NUGET_ACCESSTOKEN) --build-arg FEED_URI=$(azdo_artifact_feed_uri)
61+
3162 # Build mock-register
3263 - task : Docker@2
3364 displayName : Build mock-register image
4879 buildContext : $(Build.SourcesDirectory)/cdr-auth-server/Source
4980 repository : cdr-auth-server
5081 tags : latest
51-
82+
5283 # List docker images
5384 - task : Docker@2
5485 displayName : List Docker images
@@ -61,23 +92,16 @@ steps:
6192 # ##################################################################################################
6293
6394 # Run integration tests
64- - task : DockerCompose@0
65- displayName : Integration Tests - Up
66- condition : always()
67- inputs :
68- action : Run a Docker Compose command
69- dockerComposeFile : $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml
70- dockerComposeCommand : up --abort-on-container-exit --exit-code-from getdatarecipients-integration-tests
95+ - script : |
96+ docker compose --file $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml up --abort-on-container-exit --exit-code-from getdatarecipients-integration-tests
97+ displayName: 'Integration Tests - Up'
7198
7299 # Remove integration tests
73- - task : DockerCompose@0
74- displayName : Integration Tests - Down
75- condition : always()
76- inputs :
77- action : Run a Docker Compose command
78- dockerComposeFile : $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml
79- dockerComposeCommand : down
80-
100+ - script : |
101+ docker compose --file $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml down
102+ displayName: 'Integration Tests - Down'
103+ condition: always()
104+
81105 # NOTE - volume no longer mapped as 1001:121 (vsts:docker) in build pipeline and causes issue with chown in dockerfile (appuser:appgroup), ie stops register from starting because of different user
82106 # # Publish mock-register logs
83107 # - publish: $(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/mock-register/tmp
@@ -98,14 +122,14 @@ steps:
98122 condition : always()
99123 inputs :
100124 command : login
101- containerRegistry : <<yourContainerRegistryName>>
125+ containerRegistry : $(AcrBaseUrl)
102126
103127 # Run trx formatter to output .MD and .CSV
104128 - script : |
105129 docker run \
106130 -v=$(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/getdatarecipients-integration-tests/testresults/results.trx:/app/results.trx:ro \
107131 -v=$(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/getdatarecipients-integration-tests/testresults/formatted/:/app/out/:rw \
108- <<yourContainerRegistryName>> .azurecr.io/trx-formatter -i results.trx -t "CDRAuthServer-GetDataRecipients" --outputprefix "CDRAuthServer-GetDataRecipients" -o out/
132+ $(AcrBaseUrl) .azurecr.io/trx-formatter -i results.trx -t "CDRAuthServer-GetDataRecipients" --outputprefix "CDRAuthServer-GetDataRecipients" -o out/
109133 displayName: 'Run trx-formatter'
110134 condition: always()
111135
@@ -132,10 +156,10 @@ steps:
132156 # Tests have passed, so now build/publish the azure function
133157
134158 - task : UseDotNet@2
135- displayName : ' Install .NET 6 SDK'
159+ displayName : ' Install .NET 8 SDK'
136160 inputs :
137161 packageType : ' sdk'
138- version : ' 6 .0.x'
162+ version : ' 8 .0.x'
139163 performMultiLevelLookup : true
140164
141165 - script : |
0 commit comments