Permalink
Browse files

build: more paramaterization

Add more paramaterization to the VSTS build template.

 - Make the nuget restore operation paramertized.
 - Make the core build operation paramertized.
 - Correctly enquote parameters.
  • Loading branch information...
gistofj committed Aug 9, 2018
1 parent ed7e810 commit 49e4107005e3e02c20e67c2961ee7ef4067e7f86
Showing with 78 additions and 24 deletions.
  1. +25 −0 vsts-ci.yml
  2. +20 −0 vsts-pr.yml
  3. +29 −4 vsts-rs.yml
  4. +4 −20 vsts-tt.yml
View
@@ -31,9 +31,34 @@ phases:
- template: vsts-tt.yml
parameters:
QueueName: 'Hosted VS2017'
CoreBuild:
- task: MSBuild@1
displayName: 'Core Build'
inputs:
solution: 'Installer/Installer.proj'
msbuildArguments: '/nologo /verbosity:$(Build.Verbosity) /binaryLogger:$(Build.SourcesDirectory)/$(build.buildNumber).binlog'
platform: '$(Build.Platform)'
configuration: '$(Build.Configuration)'
maximumCpuCount: false
msbuildArchitecture: '$(Build.Architecture)'
MicrobuildSetup: []
MicrobuildClean: []
NugetCommand:
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
restoreSolution: 'GitCredentialManager.sln'
verbosityRestore: 'quiet'
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
command: custom
arguments: restore "$(Build.SourcesDirectory)\Installer\packages.config" -PackagesDirectory "$(Build.SourcesDirectory)\packages" -SolutionDirectory "$(Build.SourcesDirectory)" -Verbosity Quiet
PublishArtifacts:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Binary Log'
View
@@ -31,6 +31,26 @@ phases:
- template: vsts-tt.yml
parameters:
QueueName: 'Hosted VS2017'
CoreBuild:
- task: MSBuild@1
displayName: 'Core Build'
inputs:
solution: "GitCredentialManager.sln"
msbuildArguments: /nologo /verbosity:$(Build.Verbosity) "/binaryLogger:$(Build.SourcesDirectory)/$(build.buildNumber).binlog"
platform: '$(Build.Platform)'
configuration: '$(Build.Configuration)'
maximumCpuCount: false
msbuildArchitecture: '$(Build.Architecture)'
MicrobuildSetup: []
MicrobuildClean: []
NugetCommand:
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
restoreSolution: 'GitCredentialManager.sln'
verbosityRestore: 'quiet'
PublishArtifacts: []
View
@@ -30,6 +30,18 @@ phases:
- template: vsts-tt.yml
parameters:
QueueName: 'VSEng-MicroBuildVS2017'
CoreBuild:
- task: MSBuild@1
displayName: 'Core Build'
inputs:
solution: 'Installer/Installer.proj'
msbuildArguments: '/nologo /verbosity:$(Build.Verbosity) "/binaryLogger:$(Build.SourcesDirectory)/$(build.buildNumber).binlog"'
platform: '$(Build.Platform)'
configuration: '$(Build.Configuration)'
maximumCpuCount: false
msbuildArchitecture: '$(Build.Architecture)'
MicrobuildSetup:
- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
displayName: Setup MicroBuild Signing
@@ -46,21 +58,34 @@ phases:
condition: or(eq(variables['signType'],'real'), eq(variables['signType'],'test'))
continueOnError: true
NugetCommand:
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
restoreSolution: 'GitCredentialManager.sln'
verbosityRestore: 'quiet'
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
command: custom
arguments: restore "$(Build.SourcesDirectory)\Installer\packages.config" -PackagesDirectory "$(Build.SourcesDirectory)\packages" -SolutionDirectory "$(Build.SourcesDirectory)" -Verbosity Quiet
PublishArtifacts:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Binary Log'
continueOnError: true
condition: eq(variables['system.pullrequest.isfork'], false)
inputs:
pathtoPublish: '$(Build.SourcesDirectory)\$(build.buildNumber).binlog'
artifactName: '$(build.buildNumber).binlog'
pathtoPublish: "$(Build.SourcesDirectory)\$(build.buildNumber).binlog"
artifactName: "$(build.buildNumber).binlog"
publishLocation: Container
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Binaries'
continueOnError: true
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
inputs:
pathtoPublish: '$(Build.SourcesDirectory)\Deploy\'
artifactName: '$(Build.BuildNumber).output'
pathtoPublish: "$(Build.SourcesDirectory)\Deploy\"
artifactName: "$(Build.BuildNumber).output"
publishLocation: Container
View
@@ -28,8 +28,10 @@
parameters:
QueueName: ''
CoreBuild: []
MicrobuildSetup: []
MicrobuildClean: []
NugetCommand: []
PublishArtifacts: []
phases:
@@ -47,29 +49,11 @@ phases:
inputs:
versionSpec: 4.4.0
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
restoreSolution: '$(Build.Solution)'
verbosityRestore: 'quiet'
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
command: custom
arguments: restore '$(Build.SourcesDirectory)\$(Build.Target)' '-SolutionDirectory $(Build.SourcesDirectory)'
- ${{ parameters.NugetCommand }}
- ${{ parameters.MicrobuildSetup }}
- task: MSBuild@1
displayName: 'Core Build'
inputs:
solution: '$(Build.Target)'
msbuildArguments: '/nologo /verbosity:$(Build.Verbosity) /binaryLogger:$(Build.SourcesDirectory)/$(build.buildNumber).binlog'
platform: '$(Build.Platform)'
configuration: '$(Build.Configuration)'
maximumCpuCount: false
msbuildArchitecture: '$(Build.Architecture)'
- ${{ parameters.CoreBuild }}
- task: VSTest@2
displayName: 'Execute Tests (Xunit)'

0 comments on commit 49e4107

Please sign in to comment.