Created
March 25, 2020 23:21
-
-
Save DamianEdwards/a173cc518a0c31217dd1dfce205e1ce6 to your computer and use it in GitHub Desktop.
.NET Core Azure stuff
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
# 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 | |
trigger: | |
branches: | |
include: | |
- master | |
paths: | |
include: | |
- src/* | |
pr: | |
branches: | |
include: | |
- master | |
paths: | |
include: | |
- src/* | |
pool: | |
vmImage: 'ubuntu-latest' | |
variables: | |
buildConfiguration: 'Release' | |
rid: 'linux-x64' | |
projectPath: 'src/' | |
steps: | |
- task: UseDotNet@2 | |
inputs: | |
version: '3.1.x' | |
packageType: sdk | |
# includePreviewVersions: true | |
- task: DotNetCoreCLI@2 | |
displayName: "Restore" | |
inputs: | |
command: 'restore' | |
projects: '$(projectPath)/**/*.csproj' | |
restoreArguments: '-r $(rid) /p:Configuration="$(buildConfiguration)"' | |
- script: 'echo -e "\"$(Build.BuildNumber)|$(Build.BuildId)\"" > buildinfo.json' | |
displayName: "Emit build information" | |
workingDirectory: '$(Build.SourcesDirectory)/$(projectPath)' | |
failOnStderr: true | |
- task: DotNetCoreCLI@2 | |
displayName: "Build" | |
inputs: | |
command: 'build' | |
projects: '$(projectPath)/**/*.csproj' | |
arguments: '-r $(rid) --configuration "$(buildConfiguration)" --no-restore /p:SourceRevisionId=$(Build.SourceVersion) /p:BuildNumber=$(Build.BuildNumber) /p:BuildId=$(Build.BuildId)' | |
- task: DotNetCoreCLI@2 | |
displayName: "Publish" | |
inputs: | |
command: 'publish' | |
projects: '$(projectPath)/**/*.csproj' | |
publishWebProjects: true | |
arguments: '-r $(rid) --configuration "$(BuildConfiguration)" --no-build --output $(Build.ArtifactStagingDirectory)' | |
zipAfterPublish: true | |
- task: PublishBuildArtifacts@1 | |
displayName: "Upload Artifacts" | |
inputs: | |
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | |
artifactName: 'webapp' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment