This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ba3b722
Showing
710 changed files
with
102,494 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
# Build pipeline v2 (Containerised) | ||
|
||
resources: | ||
repositories: | ||
- repository: MockRegister | ||
type: git | ||
name: sb-mock-register | ||
ref: develop | ||
|
||
trigger: | ||
- develop | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
|
||
steps: | ||
|
||
# Checkout repositories | ||
- checkout: MockRegister | ||
- checkout: self | ||
|
||
# Build mock-register | ||
- task: Docker@2 | ||
displayName: Build mock-register image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-register/Source/Dockerfile | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-register/Source | ||
repository: mock-register | ||
tags: latest | ||
|
||
# Build mock-data-holder-energy | ||
- task: Docker@2 | ||
displayName: Build mock-data-holder-energy image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/Dockerfile | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source | ||
repository: mock-data-holder-energy | ||
tags: latest | ||
|
||
# Build mock-data-holder-energy-unit-tests | ||
- task: Docker@2 | ||
displayName: Build mock-data-holder-energy-unit-tests image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/Dockerfile.unit-tests | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source | ||
repository: mock-data-holder-energy-unit-tests | ||
tags: latest | ||
|
||
# Build mock-data-holder-energy-integration-tests | ||
- task: Docker@2 | ||
displayName: Build mock-data-holder-energy-integration-tests image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/Dockerfile.integration-tests | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source | ||
repository: mock-data-holder-energy-integration-tests | ||
tags: latest | ||
|
||
# List docker images | ||
- task: Docker@2 | ||
displayName: List Docker images | ||
condition: always() | ||
inputs: | ||
command: images | ||
|
||
# Run unit tests | ||
- task: DockerCompose@0 | ||
displayName: Unit Tests - Up | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/docker-compose.UnitTests.yml | ||
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-data-holder-energy-unit-tests | ||
|
||
# Remove unit tests | ||
- task: DockerCompose@0 | ||
displayName: Unit Tests - Down | ||
condition: always() | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/docker-compose.UnitTests.yml | ||
dockerComposeCommand: down | ||
|
||
# Run integration tests | ||
- task: DockerCompose@0 | ||
displayName: Integration Tests - Up | ||
condition: always() | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/docker-compose.IntegrationTests.yml | ||
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-data-holder-energy-integration-tests | ||
|
||
# Remove integration tests | ||
- task: DockerCompose@0 | ||
displayName: Integration Tests - Down | ||
condition: always() | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/docker-compose.IntegrationTests.yml | ||
dockerComposeCommand: down | ||
|
||
# Save docker image to TAR so it can be published | ||
- task: Docker@2 | ||
displayName: Save MockDataHolder-Energy image to TAR | ||
# condition: always() | ||
inputs: | ||
repository: mock-data-holder | ||
command: save | ||
arguments: --output $(build.artifactstagingdirectory)/mock-data-holder-energy.image.tar mock-data-holder-energy | ||
addPipelineData: false | ||
|
||
# Publish docker image | ||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish container images | ||
# condition: always() | ||
inputs: | ||
path: $(build.artifactstagingdirectory) | ||
artifact: Container Images | ||
|
||
# Publish mock-register logs | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/_temp/mock-register/tmp | ||
displayName: Publish MockRegister logs | ||
condition: always() | ||
artifact: Mock-Register - Logs | ||
|
||
# Publish mock-data-holder logs | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/_temp/mock-data-holder-energy/tmp | ||
displayName: Publish MockDataHolder logs | ||
condition: always() | ||
artifact: Mock-Data-Holder-Energy - Logs | ||
|
||
# Publish mock-data-holder unit tests results | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/_temp/mock-data-holder-energy-unit-tests/testresults | ||
displayName: Publish unit tests | ||
condition: always() | ||
artifact: Mock-Data-Holder-Energy - Unit tests | ||
|
||
# Publish mock-data-holder integration tests results | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/_temp/mock-data-holder-energy-integration-tests/testresults | ||
displayName: Publish integration tests | ||
condition: always() | ||
artifact: Mock-Data-Holder-Energy - Integration tests | ||
|
||
# TODO - MJS - Run formatter over TRX to produce formatted report suitable for attaching to Devops US & publish as artifact | ||
|
||
- task: UseDotNet@2 | ||
displayName: 'Use .NET 6 sdk' | ||
condition: always() | ||
inputs: | ||
packageType: sdk | ||
version: '6.0.x' | ||
performMultiLevelLookup: true | ||
|
||
- task: CmdLine@2 | ||
displayName: 'Install dotnet-ef' | ||
condition: always() | ||
inputs: | ||
script: 'dotnet tool install --global dotnet-ef' | ||
|
||
- task: CmdLine@2 | ||
displayName: 'Check dotnet-ef version' | ||
condition: always() | ||
inputs: | ||
script: 'dotnet-ef' | ||
|
||
- script: | | ||
cd $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/CDR.DataHolder.Repository | ||
dotnet ef migrations bundle --context DataHolderDatabaseContext --verbose --self-contained | ||
ls | ||
displayName: 'Run EF Migrations bundle' | ||
condition: always() | ||
|
||
- publish: $(Build.SourcesDirectory)/sb-mock-data-holder-energy/Source/CDR.DataHolder.Repository/efbundle | ||
displayName: Publish EF Migration bundle | ||
condition: always() | ||
artifact: Database Migration Scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
schedules: | ||
- cron: "0 14 * * *" | ||
displayName: Daily Dependabot Run | ||
branches: | ||
include: | ||
- refs/heads/develop | ||
always: true | ||
|
||
jobs: | ||
- job: dependabot | ||
displayName: Dependabot | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- task: CmdLine@2 | ||
displayName: clone dependabot repo | ||
inputs: | ||
script: | | ||
git clone https://github.com/dependabot/dependabot-script.git | ||
- task: CmdLine@2 | ||
displayName: pull dependabot-core Docker image | ||
inputs: | ||
script: docker pull dependabot/dependabot-core | ||
- task: CmdLine@2 | ||
displayName: install dependencies | ||
inputs: | ||
script: | | ||
cd dependabot-script | ||
docker run -v "$(pwd):/home/dependabot/dependabot-script" \ | ||
--user $(id -u):$(id -g) \ | ||
-w /home/dependabot/dependabot-script dependabot/dependabot-core bundle install \ | ||
-j 3 \ | ||
--path vendor | ||
- task: CmdLine@2 | ||
displayName: remove new line chars | ||
inputs: | ||
script: sed -i 's/\r//g' .azuredevops/pipelines/scripts/dependabot-devops.sh | ||
- task: Bash@3 | ||
displayName: run dependabot nuget | ||
inputs: | ||
filePath: '.azuredevops/pipelines/scripts/dependabot-devops.sh' | ||
env: | ||
PACKAGE_MANAGER: 'nuget' | ||
SOURCE_CODE_PATH: '/Source' | ||
PERSONAL_ACCESS_TOKEN: $(PERSONAL_ACCESS_TOKEN) | ||
- task: Bash@3 | ||
displayName: run dependabot docker | ||
inputs: | ||
filePath: '.azuredevops/pipelines/scripts/dependabot-devops.sh' | ||
env: | ||
PACKAGE_MANAGER: 'docker' | ||
SOURCE_CODE_PATH: '/Source' | ||
PERSONAL_ACCESS_TOKEN: $(PERSONAL_ACCESS_TOKEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
resources: | ||
repositories: | ||
- repository: MockRegister | ||
type: git | ||
name: sb-mock-register | ||
ref: develop | ||
|
||
trigger: | ||
- develop | ||
|
||
pool: | ||
vmImage: windows-2019 | ||
|
||
steps: | ||
|
||
# Checkout repositories | ||
- checkout: MockRegister | ||
- checkout: self | ||
|
||
# Restore projects | ||
- task: DotNetCoreCLI@2 | ||
displayName: Restore | ||
inputs: | ||
command: restore | ||
projects: '**/*.csproj' | ||
|
||
# Build projects in release mode | ||
- task: DotNetCoreCLI@2 | ||
displayName: Build | ||
inputs: | ||
command: 'build' | ||
arguments: '--configuration Release' | ||
projects: '**/*.csproj' | ||
|
||
# Set timezone to AEST | ||
- task: CmdLine@2 | ||
displayName: Set AEST timezone | ||
inputs: | ||
script: | | ||
cd $(Build.SourcesDirectory) | ||
tzutil /s "AUS Eastern Standard Time" | ||
# Install certificates | ||
- task: PowerShell@2 | ||
displayName: Install certificates | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$PlainPassword = "#M0ckCDRCA#" | ||
$SecurePassword = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force | ||
Import-PfxCertificate -Password $SecurePassword -FilePath "sb-mock-data-holder/CertificateManagement/mtls/ca.pfx" -CertStoreLocation Cert:\LocalMachine\Root | ||
$PlainPassword = "#M0ckDataHolder#" | ||
$SecurePassword = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force | ||
Import-PfxCertificate -Password $SecurePassword -FilePath "sb-mock-data-holder/CertificateManagement/tls/mock-data-holder.pfx" -CertStoreLocation Cert:\LocalMachine\Root | ||
# Create CDR folder for unit tests | ||
- task: CmdLine@2 | ||
displayName: Create CDR folder | ||
inputs: | ||
script: | | ||
mkdir D:\\a\\mock-data-holder\\mock-data-holder\\cdr | ||
# Run unit tests | ||
- task: VSTest@2 | ||
displayName: Unit Tests | ||
inputs: | ||
testSelector: 'testAssemblies' | ||
testAssemblyVer2: | | ||
**\*DataHolder*UnitTests*.dll | ||
!**\*TestAdapter.dll | ||
!**\obj\** | ||
!**/ref/** | ||
searchFolder: '$(System.DefaultWorkingDirectory)' | ||
|
||
# Delete unit test DB | ||
- task: CmdLine@2 | ||
displayName: Delete unit test db file | ||
inputs: | ||
script: | | ||
cd D:\\a\\mock-data-holder\\mock-data-holder\\cdr | ||
del /Q mdh.db | ||
# Run Register APIs | ||
- task: CmdLine@2 | ||
displayName: Run Register projects | ||
inputs: | ||
script: | | ||
cd $(Build.SourcesDirectory)\sb-mock-register\Source | ||
cd CDR.Register.IdentityServer | ||
start /B dotnet run CDR.Register.IdentityServer.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.Register.IdentityServer.Pipeline | ||
cd $(Build.SourcesDirectory)\sb-mock-register\Source | ||
cd CDR.Register.SSA.API | ||
start /B dotnet run CDR.Register.SSA.API.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.Register.SSA.API.Pipeline | ||
cd $(Build.SourcesDirectory)\sb-mock-register\Source | ||
cd CDR.Register.Admin.API | ||
start /B dotnet run CDR.Register.Admin.API.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.Register.Admin.API.Pipeline | ||
cd $(Build.SourcesDirectory)\sb-mock-register\Source | ||
cd CDR.Register.API.Gateway.TLS | ||
start /B dotnet run CDR.Register.API.Gateway.TLS.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.Register.API.Gateway.TLS.Pipeline | ||
cd $(Build.SourcesDirectory)\sb-mock-register\Source | ||
cd CDR.Register.API.Gateway.mTLS | ||
start /B dotnet run CDR.Register.API.Gateway.mTLS.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.Register.API.Gateway.mTLS.Pipeline | ||
cd $(Build.SourcesDirectory) | ||
# Run DataHolder APIs | ||
- task: CmdLine@2 | ||
displayName: Run DH projects | ||
inputs: | ||
script: | | ||
echo Starting CDR.DataHolder.API.Gateway.mTLS | ||
cd $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.API.Gateway.mTLS | ||
start /B dotnet run CDR.DataHolder.API.Gateway.mTLS.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.DataHolder.API.Gateway.mTLS.Pipeline | ||
echo Starting CDR.DataHolder.IdentityServer | ||
cd $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.IdentityServer | ||
start /B dotnet run CDR.DataHolder.IdentityServer.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.DataHolder.IdentityServer.Pipeline | ||
echo Starting CDR.DataHolder.Resource.API | ||
cd $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.Resource.API | ||
start /B dotnet run CDR.DataHolder.Resource.API.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.DataHolder.Resource.API.Pipeline | ||
echo Starting CDR.DataHolder.Manage.API | ||
cd $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.Manage.API | ||
start /B dotnet run CDR.DataHolder.Manage.API.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.DataHolder.Manage.API.Pipeline | ||
echo Starting CDR.DataHolder.Public.API | ||
cd $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.Public.API | ||
start /B dotnet run CDR.DataHolder.Public.API.csproj --no-build --no-restore --configuration=Release --launch-profile CDR.DataHolder.Public.API.Pipeline | ||
cd $(Build.SourcesDirectory) | ||
# Run integration tests | ||
- task: VSTest@2 | ||
displayName: Integration Tests | ||
inputs: | ||
runSettingsFile: $(Build.SourcesDirectory)\sb-mock-data-holder\Source\CDR.DataHolder.IntegrationTests\integration.runsettings | ||
testSelector: 'testAssemblies' | ||
testAssemblyVer2: | | ||
**\*DataHolder*IntegrationTests*.dll | ||
!**\*TestAdapter.dll | ||
!**\obj\** | ||
!**/ref/** | ||
searchFolder: '$(System.DefaultWorkingDirectory)' | ||
|
||
# Stop APIs and copy artifacts for integration tests | ||
- template: templates/stop-apis.yml | ||
- template: templates/copy-artifacts.yml | ||
parameters: | ||
name: Integration Tests | ||
|
||
# Publish artifacts | ||
- publish: $(Build.SourcesDirectory)\Publish | ||
displayName: Publish artifacts | ||
condition: always() | ||
artifact: Mock-Data-Holder Build $(Build.BuildNumber) |
Oops, something went wrong.