Skip to content
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
260 changes: 28 additions & 232 deletions .azuredevops/pipelines/build-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,6 @@ pool:
vmImage: ubuntu-latest

steps:
- task: PowerShell@2
displayName: Update Obligation date
inputs:
targetType: 'inline'
script: |
$RegisterObligationDate = "$(ObligationDate)"
if (-not [string]::IsNullOrWhiteSpace( $RegisterObligationDate )) {
Write-Host "##vso[task.setvariable variable=ObligationDateTag]$RegisterObligationDate"
}
else {
Write-Host "##vso[task.setvariable variable=ObligationDateTag]23-5"
}

# Set release version variables for release tags
- task: PowerShell@2
name: 'splitBranchName'
displayName: 'Split Branch Name'
inputs:
targetType: 'inline'
script: |
$branchParts = "$(Build.SourceBranchName)" -split '\.'
# Write-Host "Branch Name: $branchParts"
$majorVersion = $branchParts[0]
$minorVersion = $branchParts[1]
#$patchVersion = $branchParts[2]
# Write-Host "Major Name: $majorVersion"
Write-Host "##vso[task.setvariable variable=majorVersion]$majorVersion"
Write-Host "##vso[task.setvariable variable=minorVersion]$minorVersion"
Write-Host "##vso[task.setvariable variable=majorMinorVersion]$majorVersion.$minorVersion"

# Build mock-register
- task: Docker@2
displayName: Build mock-register image
Expand Down Expand Up @@ -93,14 +63,6 @@ steps:
docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.UnitTests.yml down
displayName: 'Unit Tests - Down'
condition: always()

# Login to ACR
- task: Docker@2
displayName: Login to ACR
condition: always()
inputs:
command: login
containerRegistry: $(AcrBaseUrl)

# Login to Shared ACR
- task: Docker@2
Expand Down Expand Up @@ -128,7 +90,7 @@ steps:
docker run \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
$(AcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/
$(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/
displayName: 'Run trx-formatter'
condition: always()
env:
Expand Down Expand Up @@ -181,7 +143,7 @@ steps:
docker run \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \
-v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
$(AcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR-CTS" --outputprefix "MR-CTS" -o out/
$(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR-CTS" --outputprefix "MR-CTS" -o out/
displayName: 'Run trx-formatter'
condition: always()

Expand Down Expand Up @@ -269,203 +231,37 @@ steps:
condition: always()
artifact: Database Migration Scripts

- task: Docker@2
displayName: 'Re-Tag Mock Register container image with :branch-name'
inputs:
containerRegistry: $(AcrBaseUrl)
repository: 'mock-register'
command: tag
# arguments: 'mock-register-for-testing $(AcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)'
arguments: 'mock-register $(AcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)'

- task: Docker@2
displayName: 'Re-Tag Register API image with :latest (for develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: $(AcrBaseUrl)
repository: 'mock-register'
command: tag
# arguments: 'mock-register-for-testing $(AcrBaseUrl).azurecr.io/mock-register:latest'
arguments: 'mock-register $(AcrBaseUrl).azurecr.io/mock-register:latest'

# Shared SP ACR
# Pipeline variables are required : SharedAcrBaseUrl and SpSharedAcr

# develop branch tags
- task: Docker@2
displayName: 'Re-Tag Register API image with develop-latest (for develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:develop-latest'

# develop-latest-obligation-date tag
- task: Docker@2
displayName: 'Re-Tag Register API image with develop-latest-{obligation-date} (for develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:develop-latest-$(ObligationDateTag)'

# develop branch> build number tag only
- task: Docker@2
displayName: 'Re-Tag Register API image with build number (for develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.BuildId)'

# main branch tags
# Pipeline variables are required : SharedAcrBaseUrl
- task: Docker@2
displayName: 'Re-Tag Register API image with main-latest (for main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:main-latest'

# main-latest-obligation-date tag
- task: Docker@2
displayName: 'Re-Tag Register API image with main-latest-{obligation-date} (for main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:main-latest-$(ObligationDateTag)'

# Build number tag
- task: Docker@2
displayName: 'Re-Tag Register API image with build number (for main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.BuildId)'

# Re tag for full version for releases branch
- task: Docker@2
displayName: 'Re-Tag Register API image with full version for releases branch'
# Cannot use releases/* wildcard
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)'

# Re tag release full version and obligation date
- task: Docker@2
displayName: 'Re-Tag Register API image with releases-{obligation-date} for releases branch'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)-$(ObligationDateTag)'

# Re tag Major and Mnior Tags using above variables
- task: Docker@2
displayName: 'Re-Tag Register image with major and minor tags for releases branch'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:"$(majorMinorVersion)"'

# Re tag Major release Tag using above variables
- task: Docker@2
displayName: 'Re-Tag Register image with major tag for releases branch'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
containerRegistry: $(SpSharedAcr)
repository: 'mock-register'
command: tag
arguments: 'mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:"$(majorVersion)"'

# Pushing develop branch tags changes to the ACR
- task: CmdLine@2
displayName: 'Push Register container image with :branch-name tag to ACR'
inputs:
script: 'docker push $(AcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)'

- task: CmdLine@2
displayName: 'Push Register container image with :latest tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
- task: Bash@3
displayName: 'Tag and push Mock Register image with Source Branch Name for any successful builds.'
condition: succeeded()
inputs:
script: 'docker push $(AcrBaseUrl).azurecr.io/mock-register:latest'
targetType: inline
script: |
echo Tagging mock-register with Source Branch Name: $(Build.SourceBranchName)
docker tag mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)

- task: CmdLine@2
displayName: 'Push Register container image with :develop-latest tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:develop-latest'
echo Pushing all tags to $(SharedAcrBaseUrl).azurecr.io/mock-register
docker image push --all-tags $(SharedAcrBaseUrl).azurecr.io/mock-register

- task: CmdLine@2
displayName: 'Push Register container image with :develop-latest-obligation-date tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:develop-latest-$(ObligationDateTag)'

- task: CmdLine@2
displayName: 'Push Register container image with :build id tag to ACR (develop branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
- task: Bash@3
displayName: 'Tag and Push Mock Register images for develop, main and release branches.'
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/')))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.BuildId)'
targetType: inline
script: |
echo Tagging mock-register with latest tag
docker tag mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:latest

# Pushing main branch tags changes to the ACR
- task: CmdLine@2
displayName: 'Push Register container image with :main-latest tag to ACR (main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:main-latest'
echo Tagging mock-register with Source Branch Name-latest: $(Build.SourceBranchName)-latest
docker tag mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)-latest

- task: CmdLine@2
displayName: 'Push Register container image with :main-latest-obligation-date tag to ACR (main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:main-latest-$(ObligationDateTag)'

- task: CmdLine@2
displayName: 'Push Register container image with :build id tag to ACR (main branch only)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.BuildId)'

# Push release full version Tag
- task: CmdLine@2
displayName: 'Push Register container image with releases tags to ACR (releases branch only)'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)'
if [ -n "$(ObligationDate)" ]; then
echo Tagging mock-register with obligation date: $(Build.SourceBranchName)-$(ObligationDate)
docker tag mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)-$(ObligationDate)
fi

# Push release full version Tag and obligation date
- task: CmdLine@2
displayName: 'Push Register container image with releases tags to ACR (releases branch only)'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.SourceBranchName)-$(ObligationDateTag)'
echo Tagging mock-register with build id: $(Build.BuildId)
docker tag mock-register $(SharedAcrBaseUrl).azurecr.io/mock-register:$(Build.BuildId)

# Push Major and Minor release Tags using above variables
- task: CmdLine@2
displayName: 'Push Register container image with releases tags to ACR (releases branch only)'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:"$(majorMinorVersion)"'

# Push Major release Tag using above variables
- task: CmdLine@2
displayName: 'Push Register container image with releases tags to ACR (releases branch only)'
condition: eq(startsWith(variables['Build.SourceBranch'], 'refs/heads/releases/'), 'True')
inputs:
script: 'docker push $(SharedAcrBaseUrl).azurecr.io/mock-register:"$(majorVersion)"'
echo Pushing all tags to $(SharedAcrBaseUrl).azurecr.io/mock-register
docker image push --all-tags $(SharedAcrBaseUrl).azurecr.io/mock-register
24 changes: 24 additions & 0 deletions .azuredevops/pipelines/code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resources:
repositories:
- repository: shared-code-scanning
type: git
name: Common/shared-code-scanning
ref: refs/heads/main
trigger: none

schedules:
- cron: '0 17 * * 0' # Run at 17:00 Sunday night UTC (03:00+10:00 Monday Morning)
displayName: 'Weekly code scan'
branches:
include:
- develop
always: true

# Disable standard CI build
trigger: none

pool:
vmImage: 'ubuntu-latest'

extends:
template: pipeline-templates/code-scanning.yml@shared-code-scanning
27 changes: 8 additions & 19 deletions .azuredevops/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
**Checklist:** (Put an `x` in all the boxes that apply)
- [ ] My code follows the code style of this project.
- [ ] I have set this Pull Request to Auto Complete with the delete source branch option selected.
- [ ] Commented out code has been removed or will be removed.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] I have updated the `CHANGELOG.md` file as appropriate.


**What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)


**What is the new behaviour?**

**What is the current behavior?** (You can also link to an open issue here)
(if this is a feature change)


**Does this PR introduce a breaking change?**

**What is the new behavior?** (if this is a feature change)



**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)
(What changes might users need to make in their application due to this PR?)



**Other information**:

**Checklist:** (Put an `x` in all the boxes that apply)
- [ ] I have set this Pull Request to auto complete with the delete source branch option selected.
- [ ] I have updated the documentation in confluence or relevant readme.md text accordingly.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.2.1] - 2025-06-19
### Changed
- Fixed multiple build warnings to improve code quality and maintainability

## [2.2.0] - 2025-03-19
### Changed
- Updated NuGet packages
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Consumer Data Right Logo](./cdr-logo.png?raw=true)

[![Consumer Data Standards v1.33.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.33.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction)
[![Consumer Data Standards v1.34.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.34.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction)
[![made-with-dotnet](https://img.shields.io/badge/Made%20with-.NET-1f425Ff.svg)](https://dotnet.microsoft.com/)
[![made-with-csharp](https://img.shields.io/badge/Made%20with-C%23-1f425Ff.svg)](https://docs.microsoft.com/en-us/dotnet/csharp/)
[![MIT License](https://img.shields.io/github/license/ConsumerDataRight/mock-register)](./LICENSE)
Expand All @@ -12,7 +12,7 @@ This project includes source code, documentation and instructions for the Consum
The ACCC operates the CDR Register within the CDR ecosystem. This repository contains a mock implementation of the CDR Register and is offered to help the community in the development and testing of their CDR solutions.

## Mock Register - Alignment
The Mock Register aligns to [v1.33.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.33.0/#introduction).
The Mock Register aligns to [v1.34.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction).

## Getting Started
There are a number of ways that the artefacts within this project can be used:
Expand Down
Loading
Loading