Skip to content

Commit

Permalink
release v0.2.0 to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
CDR-AmirM authored May 25, 2022
1 parent 13269b9 commit 9253185
Show file tree
Hide file tree
Showing 245 changed files with 9,536 additions and 6,834 deletions.
254 changes: 254 additions & 0 deletions .azuredevops/pipelines/build-v2.yml
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
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ steps:
del /Q mdr.db
# Start APIs
- template: Pipeline/start-apis.yml
- template: templates/start-apis.yml

# Run integration tests
- task: VSTest@2
Expand Down
5 changes: 4 additions & 1 deletion .azuredevops/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
**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, ...)

Expand All @@ -21,4 +25,3 @@


**Other information**:

1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exemptLabels:
- security
- investigating
- bug report
- backlog
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
Loading

0 comments on commit 9253185

Please sign in to comment.