Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.0 release #19

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 44 additions & 20 deletions .azuredevops/pipelines/build-dr-func-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ resources:
name: sb-mock-register
ref: develop

schedules:
- cron: '0 3 * * 0'
displayName: 'Run at 3:00 AM every Sunday (UTC)'
always: true
branches:
include:
- develop

trigger:
- develop
- main
Expand All @@ -15,6 +23,9 @@ trigger:
pool:
vmImage: ubuntu-latest

variables:
- group: artifacts

steps:

###################################################################################################
Expand All @@ -28,6 +39,26 @@ steps:
# Build images
###################################################################################################

# Authenticate to the Azure DevOps artifacts feed. The VSS_NUGET_ACCESSTOKEN environment variable is set from this task.
- task: NuGetAuthenticate@1
displayName: 'Authenticate to NuGet'

# Build getdatarecipients
- task: Bash@3
displayName: Build getdatarecipients image
inputs:
targetType: inline
script: |
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)

# Build getdatarecipients-integration-tests
- task: Bash@3
displayName: Build getdatarecipients-integration-tests image
inputs:
targetType: inline
script: |
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)

# Build mock-register
- task: Docker@2
displayName: Build mock-register image
Expand All @@ -48,7 +79,7 @@ steps:
buildContext: $(Build.SourcesDirectory)/cdr-auth-server/Source
repository: cdr-auth-server
tags: latest

# List docker images
- task: Docker@2
displayName: List Docker images
Expand All @@ -61,23 +92,16 @@ steps:
###################################################################################################

# Run integration tests
- task: DockerCompose@0
displayName: Integration Tests - Up
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml
dockerComposeCommand: up --abort-on-container-exit --exit-code-from getdatarecipients-integration-tests
- script: |
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
displayName: 'Integration Tests - Up'

# Remove integration tests
- task: DockerCompose@0
displayName: Integration Tests - Down
condition: always()
inputs:
action: Run a Docker Compose command
dockerComposeFile: $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml
dockerComposeCommand: down

- script: |
docker compose --file $(Build.SourcesDirectory)/cdr-auth-server/Source/docker-compose.GetDataRecipients.IntegrationTests.yml down
displayName: 'Integration Tests - Down'
condition: always()

# 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
# # Publish mock-register logs
# - publish: $(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/mock-register/tmp
Expand All @@ -98,14 +122,14 @@ steps:
condition: always()
inputs:
command: login
containerRegistry: <<yourContainerRegistryName>>
containerRegistry: $(AcrBaseUrl)

# Run trx formatter to output .MD and .CSV
- script: |
docker run \
-v=$(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/getdatarecipients-integration-tests/testresults/results.trx:/app/results.trx:ro \
-v=$(Build.SourcesDirectory)/cdr-auth-server/Source/_temp/getdatarecipients-integration-tests/testresults/formatted/:/app/out/:rw \
<<yourContainerRegistryName>>.azurecr.io/trx-formatter -i results.trx -t "CDRAuthServer-GetDataRecipients" --outputprefix "CDRAuthServer-GetDataRecipients" -o out/
$(AcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "CDRAuthServer-GetDataRecipients" --outputprefix "CDRAuthServer-GetDataRecipients" -o out/
displayName: 'Run trx-formatter'
condition: always()

Expand All @@ -132,10 +156,10 @@ steps:
# Tests have passed, so now build/publish the azure function

- task: UseDotNet@2
displayName: 'Install .NET 6 SDK'
displayName: 'Install .NET 8 SDK'
inputs:
packageType: 'sdk'
version: '6.0.x'
version: '8.0.x'
performMultiLevelLookup: true

- script: |
Expand Down
4 changes: 2 additions & 2 deletions .azuredevops/pipelines/build-dr-func.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ pool:

steps:
- task: UseDotNet@2
displayName: 'Install .NET 6 SDK'
displayName: 'Install .NET 8 SDK'
inputs:
packageType: 'sdk'
version: '6.0.x'
version: '8.0.x'
performMultiLevelLookup: true

- script: |
Expand Down
8 changes: 4 additions & 4 deletions .azuredevops/pipelines/build-for-fapi-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
condition: always()
inputs:
command: login
containerRegistry: <<yourContainerRegistryName>>
containerRegistry: $(AcrBaseUrl)

# Save docker image to TAR so it can be published
- task: Docker@2
Expand All @@ -61,13 +61,13 @@ jobs:
displayName: 'Re-Tag CDRAuthServer API image with :fapi-testing'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: <<yourContainerRegistryName>>
containerRegistry: $(AcrBaseUrl)
repository: 'cdr-auth-server'
command: tag
arguments: 'cdr-auth-server <<yourContainerRegistryName>>.azurecr.io/cdr-auth-server:fapi-testing'
arguments: 'cdr-auth-server $(AcrBaseUrl).azurecr.io/cdr-auth-server:fapi-testing'

- task: CmdLine@2
displayName: 'Push CDRAuthServer container image with :fapi-testing tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
script: 'docker push <<yourContainerRegistryName>>.azurecr.io/cdr-auth-server:fapi-testing'
script: 'docker push $(AcrBaseUrl).azurecr.io/cdr-auth-server:fapi-testing'
Loading
Loading