Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
# Build ASP.NET Core project using Azure Pipelines.
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops.
# YAML schema reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema.
# Specify build number format.
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml.
name: '$(SourceBranchName)_$(Date:yyyyMMdd).$(Rev:rrr)'
resources:
repositories:
# See more about repositories here: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#repository-resource.
- repository: 'aspnet_core_logging'
type: 'github'
name: 'satrapu/aspnet-core-logging'
clean: True
# The value of the "endpoint" element must match the service connection name
# declared in Project Settings -> Service connections section of your Azure DevOps organization.
endpoint: 'satrapu'
# Build multiple branches.
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml.
# Since satrapu is the only committer, batching should be turned off.
trigger:
batch: False
branches:
include:
- '*'
paths:
exclude:
- LICENSE
- README.md
# See more about Azure Pipelines variables here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch.
variables:
# Load group containing variables applicable to all pipelines belonging to this project.
- group: 'GlobalVariables'
# Load SonarQube related variable group.
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml#use-a-variable-group.
# Be sure to link this group to this pipeline by selecting the latter -> Edit -> Variables -> Variable Groups!
- group: 'SonarQube'
# Load group containing variables applicable to integration tests.
# This group contains the password to be used when accessing the dockerized database targeted by the integration tests.
# This password is stored as a secret under the name "IntegrationTests.Database.Todo.Password".
# See more about secret variables here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables.
- group: 'IntegrationTests'
# Specifies the version of the .NET SDK to install and use when running this pipeline.
# All releases can be found here: https://dotnet.microsoft.com/download/dotnet.
- name: 'DotNetCore_SDK_Version'
value: '5.0.302'
# Specifies the version of the dotnet-format tool used for enforcing rules found in .editorconfig files.
# All releases can be found here: https://github.com/dotnet/format/releases.
# All NuGet packages can be found here: https://www.nuget.org/packages/dotnet-format/.
- name: 'DotNetFormat_Version'
value: '5.1.225507'
# Specifies the version of the ReportGenerator tool used for generating code coverage reports.
# All releases can be found here: https://github.com/danielpalme/ReportGenerator/releases.
# All NuGet packages can be found here: https://www.nuget.org/packages/ReportGenerator/.
- name: 'ReportGenerator_Version'
value: '4.8.9'
# Represents the name of the database to be targeted by integration tests
- name: 'IntegrationTests.Database.Todo.Name'
value: 'todo-db4it'
# Represents the user used for accessing the database to be targeted by integration tests
- name: 'IntegrationTests.Database.Todo.Username'
value: 'satrapu'
# Define multiple jobs, one per supported operating system (Linux, macOS and Windows).
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml
#
# The list of virtual machine images used for running these operating systems can be found here:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#use-a-microsoft-hosted-agent.
#
# Will use job templates, since all supported operating systems will run the same job.
# See more here: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#job-templates
# and here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops.
jobs:
- template: './azure-pipelines.job-template.yml'
parameters:
job:
name: 'linux'
displayName: 'Run on Linux'
pool:
vmImage: 'ubuntu-20.04'
sonar:
enabled: True
buildBreaker:
enabled: True
integrationTests:
databaseHost: 'localhost'
databaseName: '$(IntegrationTests.Database.Todo.Name)'
databaseUsername: '$(IntegrationTests.Database.Todo.Username)'
databasePassword: '$(IntegrationTests.Database.Todo.Password)'
databaseDockerImage: 'postgres:12-alpine'
composeProjectName: 'integration-test-prerequisites'
# satrapu 2021-06-20: Due to the volatile nature of the Docker Desktop for Mac installation experience,
# I will temporarily disable running builds on macOS-based agents.
# I will enable it as soon as there is a way of installing it in an unattended way.
# See more here: https://github.com/docker/roadmap/issues/80#issuecomment-862521647.
#- template: './azure-pipelines.job-template.yml'
# parameters:
# job:
# name: 'macOS'
# displayName: 'Run on macOS'
# pool:
# vmImage: 'macOS-10.15'
# integrationTests:
# databaseHost: 'localhost'
# databaseName: '$(IntegrationTests.Database.Todo.Name)'
# databaseUsername: '$(IntegrationTests.Database.Todo.Username)'
# databasePassword: '$(IntegrationTests.Database.Todo.Password)'
# databaseDockerImage: 'postgres:12-alpine'
# composeProjectName: 'integration-test-prerequisites'
- template: './azure-pipelines.job-template.yml'
parameters:
job:
name: 'windows'
displayName: 'Run on Windows'
pool:
vmImage: 'windows-2019'
runDotNetFormatTool: True
integrationTests:
databaseHost: 'localhost'
databaseName: '$(IntegrationTests.Database.Todo.Name)'
databaseUsername: '$(IntegrationTests.Database.Todo.Username)'
databasePassword: '$(IntegrationTests.Database.Todo.Password)'
databaseDockerImage: 'stellirin/postgres-windows:12'
composeProjectName: 'integration-test-prerequisites'