The following shows examples of how to call the tasks with yaml syntax.
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: 'PipelineToTrigger'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: false
useSameBranch: true
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: false
authenticationMethod: 'OAuth Token'
password: '$(System.AccessToken)'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: 'MyPipeline'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: true
useSameSourceVersion: true
useSameBranch: true
waitForQueuedBuildsToFinish: true
waitForQueuedBuildsToFinishRefreshTime: '60'
failTaskIfBuildsNotSuccessful: true
cancelBuildsIfAnyFails: true
treatPartiallySucceededBuildAsSuccessful: true
downloadBuildArtifacts: true
dropDirectory: '$(agent.workFolder)/DownloadDirectory'
storeInEnvironmentVariable: true
demands: 'Demand1, Demand2 = Test'
queueid: 'MyCustomAgentPool'
delayBetweenBuilds: '5'
buildParameters: 'MyVariable: MyVariableValue'
templateParameters: 'MyTemplateParameter: TemplateValue'
authenticationMethod: 'OAuth Token'
password: '$(System.AccessToken)'
enableBuildInQueueCondition: true
includeCurrentBuildDefinition: true
blockingBuildsList: 'Pipeline1, Pipeline3'
blockInProgressBuilds: true
dependentOnSuccessfulBuildCondition: true
dependentBuildsList: 'Pipeline5'
dependentOnFailedBuildCondition: true
dependentFailingBuildsList: 'Pipeline12'
checkbuildsoncurrentbranch: true
failTaskIfConditionsAreNotFulfilled: true
The task will store the Build IDs of the triggered build(s) in a variable called TriggeredBuildIds
.
The task will check the TriggeredBuildIds
variable. If it's not set by the Trigger task, you can also set it manually yourself.
- task: WaitForBuildToFinish@3
inputs:
definitionIsInCurrentTeamProject: true
ignoreSslCertificateErrors: true
waitForQueuedBuildsToFinishRefreshTime: '60'
failTaskIfBuildsNotSuccessful: true
cancelBuildsIfAnyFails: false
treatPartiallySucceededBuildAsSuccessful: false
downloadBuildArtifacts: false
clearVariable: true
authenticationMethod: 'OAuth Token'
password: '$(System.AccessToken)'
The task will check the TriggeredBuildIds
variable. If it's not set by the Trigger task, you can also set it manually yourself.
- task: CancelBuildTask@3
inputs:
definitionIsInCurrentTeamProject: true
ignoreSslCertificateErrors: false
clearVariable: true
authenticationMethod: 'OAuth Token'
password: '$(System.AccessToken)'