-
Notifications
You must be signed in to change notification settings - Fork 19
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
Showing
245 changed files
with
9,536 additions
and
6,834 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,254 @@ | ||
# Build pipeline v2 (Containerised) | ||
|
||
resources: | ||
repositories: | ||
- repository: MockRegister | ||
type: git | ||
name: sb-mock-register | ||
ref: develop | ||
- repository: MockDataHolder | ||
type: git | ||
name: sb-mock-data-holder | ||
ref: develop | ||
- repository: MockDataHolder-Energy | ||
type: git | ||
name: sb-mock-data-holder-energy | ||
ref: develop | ||
|
||
trigger: | ||
- develop | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
|
||
steps: | ||
|
||
# Checkout repositories | ||
- checkout: MockRegister | ||
- checkout: MockDataHolder | ||
- checkout: MockDataHolder-Energy | ||
- 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 | ||
- task: Docker@2 | ||
displayName: Build mock-data-holder image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-holder/Source/Dockerfile | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-holder/Source | ||
repository: mock-data-holder | ||
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-recipient | ||
- task: Docker@2 | ||
displayName: Build mock-data-recipient image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/Dockerfile | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source | ||
repository: mock-data-recipient | ||
tags: latest | ||
|
||
# Build mock-data-recipient-unit-tests | ||
- task: Docker@2 | ||
displayName: Build mock-data-recipient-unit-tests image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/Dockerfile.unit-tests | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source | ||
repository: mock-data-recipient-unit-tests | ||
tags: latest | ||
|
||
# Build mock-data-recipient-integration-tests | ||
- task: Docker@2 | ||
displayName: Build mock-data-recipient-integration-tests image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/Dockerfile.integration-tests | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source | ||
repository: mock-data-recipient-integration-tests | ||
tags: latest | ||
|
||
# Build mock-data-recipient-e2e-tests | ||
- task: Docker@2 | ||
displayName: Build mock-data-recipient-e2e-tests image | ||
inputs: | ||
command: build | ||
Dockerfile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/Dockerfile.e2e-tests | ||
buildContext: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source | ||
repository: mock-data-recipient-e2e-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-recipient/Source/docker-compose.UnitTests.yml | ||
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-data-recipient-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-recipient/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-recipient/Source/docker-compose.IntegrationTests.yml | ||
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-data-recipient-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-recipient/Source/docker-compose.IntegrationTests.yml | ||
dockerComposeCommand: down | ||
|
||
# Run e2e tests | ||
- task: DockerCompose@0 | ||
displayName: E2E tests - Up | ||
condition: always() | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/docker-compose.E2ETests.yml | ||
dockerComposeCommand: up --abort-on-container-exit --exit-code-from mock-data-recipient-e2e-tests | ||
|
||
# Remove e2e tests | ||
- task: DockerCompose@0 | ||
displayName: E2E tests - Down | ||
condition: always() | ||
inputs: | ||
action: Run a Docker Compose command | ||
dockerComposeFile: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/docker-compose.E2ETests.yml | ||
dockerComposeCommand: down | ||
|
||
# Save docker image to TAR so it can be published | ||
- task: Docker@2 | ||
displayName: Save MockDataRecipient image to TAR | ||
# condition: always() | ||
inputs: | ||
repository: mock-data-recipient | ||
command: save | ||
arguments: --output $(build.artifactstagingdirectory)/mock-data-recipient.image.tar mock-data-recipient | ||
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-recipient/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-recipient/Source/_temp/mock-data-holder/tmp | ||
displayName: Publish MockDataHolder logs | ||
condition: always() | ||
artifact: Mock-Data-Holder - Logs | ||
|
||
# Publish mock-data-holder-energy logs | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-holder-energy/tmp | ||
displayName: Publish MockDataHolder-Energy logs | ||
condition: always() | ||
artifact: Mock-Data-Holder-Energy - Logs | ||
|
||
# Publish mock-data-recipient logs | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient/tmp | ||
displayName: Publish MockDataRecipient logs | ||
condition: always() | ||
artifact: Mock-Data-Recipient - Logs | ||
|
||
# Publish mock-data-recipient unit tests results | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-unit-tests/testresults | ||
displayName: Publish unit tests | ||
condition: always() | ||
artifact: Mock-Data-Recipient - Unit tests | ||
|
||
# Publish mock-data-recipient integration tests results | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-integration-tests/testresults | ||
displayName: Publish integration tests | ||
condition: always() | ||
artifact: Mock-Data-Recipient - Integration tests | ||
|
||
# Publish mock-data-recipient e2e tests results | ||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/_temp/mock-data-recipient-e2e-tests/testresults | ||
displayName: Publish e2e tests | ||
condition: always() | ||
artifact: Mock-Data-Recipient - E2E 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-recipient/Source/CDR.DataRecipient.Repository.SQL | ||
dotnet ef migrations bundle --context RecipientDatabaseContext --verbose --self-contained | ||
ls | ||
displayName: 'Run EF Migrations bundle' | ||
condition: always() | ||
|
||
- publish: $(Build.SourcesDirectory)/sb-mock-data-recipient/Source/CDR.DataRecipient.Repository.SQL/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
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
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
Oops, something went wrong.