-
-
Save kylermintah/9ce8a13244bb80acdb5770eed355cdbb to your computer and use it in GitHub Desktop.
Azure DevOps Pipelines Build & Release with YAML Templates π (Build.yaml)
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
# File: pipeline-templates/build.yaml | |
# This is a file elsewhere in the repository that represents | |
# the build stage of our pipeline | |
stages: | |
- stage: Build | |
jobs: | |
- job: Build | |
pool: | |
name: Hosted VS2017 | |
demands: | |
- msbuild | |
- visualstudio | |
- vstest | |
variables: | |
solution: '**/*.sln' | |
buildPlatform: 'Any CPU' | |
buildConfiguration: 'Release' | |
steps: | |
- task: NuGetToolInstaller@1 | |
- task: NuGetCommand@2 | |
inputs: | |
restoreSolution: '$(solution)' | |
- task: VSBuild@1 | |
inputs: | |
solution: '$(solution)' | |
msbuildArgs: >- | |
/p:DeployOnBuild=true /p:WebPublishMethod=Package | |
/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true | |
/p:PackageLocation="$(build.artifactStagingDirectory)" | |
platform: '$(buildPlatform)' | |
configuration: '$(buildConfiguration)' | |
- task: VSTest@2 | |
inputs: | |
platform: '$(buildPlatform)' | |
configuration: '$(buildConfiguration)' | |
- task: CopyFiles@2 | |
inputs: | |
SourceFolder: '$(build.sourcesdirectory)/PartsUnlimited-aspnet45/env/' | |
Contents: '**/*.json' | |
TargetFolder: '$(Build.ArtifactStagingDirectory)' | |
- task: PublishPipelineArtifact@1 | |
inputs: | |
targetPath: '$(Build.ArtifactStagingDirectory)' | |
artifact: 'drop' | |
publishLocation: 'pipeline' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment