Skip to content

Instantly share code, notes, and snippets.

@JasonLiuLiuLiuLiu
Forked from Damovisa/azure-pipelines.yml
Created April 28, 2019 03:17
Show Gist options
  • Save JasonLiuLiuLiuLiu/ad16fa4aa5807b8a9bf50f9cf27e51c0 to your computer and use it in GitHub Desktop.
Save JasonLiuLiuLiuLiu/ad16fa4aa5807b8a9bf50f9cf27e51c0 to your computer and use it in GitHub Desktop.
Azure Pipelines YML for ASP.NET Core
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet restore
displayName: 'dotnet restore'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test $(buildConfiguration)'
inputs:
command: test
projects: '**/*Tests/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish $(buildConfiguration)'
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment