Skip to content

Commit

Permalink
Updated azure=pipelines.yml to support new multi-stage build/rdeploym…
Browse files Browse the repository at this point in the history
…ent format
  • Loading branch information
ravensorb committed Jan 7, 2020
1 parent 20d69a3 commit 175ade0
Showing 1 changed file with 75 additions and 59 deletions.
134 changes: 75 additions & 59 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,85 @@
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
vmImage: 'windows-latest'
stages:
- stage: build
jobs:
- job: Build
pool:
vmImage: 'windows-latest'

variables:
- group: Invisionware.Collections
- name: solution
value: '**/*.sln'
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
- name: buildTarget
value: 'Nuget-Package'
variables:
- group: Invisionware.Collections
- name: solution
value: '**/*.sln'
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
- name: buildTarget
value: 'Nuget-Package'
steps:
- task: NuGetToolInstaller@1
displayName: 'Install Nuget Tools'

steps:
- task: NuGetToolInstaller@1
displayName: 'Install Nuget Tools'
- task: NuGetCommand@2
displayName: 'Restore nuget packages'
inputs:
restoreSolution: '$(solution)'

- task: NuGetCommand@2
displayName: 'Restore nuget packages'
inputs:
restoreSolution: '$(solution)'
- task: replacetokens@3
displayName: 'Transform appsetings.json'
inputs:
rootDirectory: '$(Build.SourcesDirectory)/tests'
targetFiles: '**/appSettings.json'
encoding: 'auto'
writeBOM: true
escapeType: 'json'
verbosity: 'detailed'
actionOnMissing: 'warn'
keepToken: false
tokenPrefix: '#{'
tokenSuffix: '}#'

- task: replacetokens@3
displayName: 'Transform appsetings.json'
inputs:
rootDirectory: '$(Build.SourcesDirectory)/tests'
targetFiles: '**/appSettings.json'
encoding: 'auto'
writeBOM: true
escapeType: 'json'
verbosity: 'detailed'
actionOnMissing: 'warn'
keepToken: false
tokenPrefix: '#{'
tokenSuffix: '}#'
- task: Cake@0
displayName: 'Build Solution: Cake'
inputs:
script: 'build.cake'
target: '$(buildTarget)'
verbosity: 'Verbose'
arguments: '-NugetArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)'

- task: Cake@0
displayName: 'Build Solution: Cake'
inputs:
script: 'build.cake'
target: '$(buildTarget)'
verbosity: 'Verbose'
arguments: '-NugetArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)'
- task: PublishTestResults@2
displayName: 'Unit Tests: Publish results'
enabled: true
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/tests/**/*.trx'
mergeTestResults: true
failTaskOnFailedTests: true

- task: PublishTestResults@2
displayName: 'Unit Tests: Publish results'
enabled: true
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/tests/**/*.trx'
mergeTestResults: true
failTaskOnFailedTests: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
enabled: true
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

- stage: nuget_deploy
jobs:
- deployment: nuget_deploy
pool:
vmImage: 'windows-latest'
environment: nuget
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Github Connection'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
enabled: true
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

0 comments on commit 175ade0

Please sign in to comment.