I am new to azure pipelines. I am using Azure devops pipeline to trigger another devops pipeline. Pipelines are written in YAML schema.
Pipeline A
- task: TriggerBuild@3
displayName: Trigger Setup Pipeline
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: '111'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: true
customSourceVersion: '$(Revision)'
useSameBranch: true
waitForQueuedBuildsToFinish: true
waitForQueuedBuildsToFinishRefreshTime: '60'
failTaskIfBuildsNotSuccessful: true
cancelBuildsIfAnyFails: false
treatPartiallySucceededBuildAsSuccessful: false
downloadBuildArtifacts: false
storeInEnvironmentVariable: false
authenticationMethod: 'OAuth Token'
password: '$(PersonalToken)'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
Pipeline B
- task: DownloadBuildArtifacts@0
condition: and(succeeded(), eq(variables['WCBuildType'], 'Internal'))
inputs:
buildType: 'specific'
project: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
pipeline: '999'
buildVersionToDownload: 'latestFromBranch' # I want to use '$(Revision)' vaue here
branchName: '$(Build.SourceBranch)'
downloadType: 'single'
artifactName: 'Compiled'
downloadPath: 'Artifact'
displayName: 'Download build artifacts'
I want to use $(Revision) value of pipeline A in pipeline B to download artifact of particular build version. I also want trigger of Pipeline B should behave differently in these two conditions:
- Whenever user make any commit in his branch, then it should use buildVersionToDownload: latestFromBranch
- Whenver user trigger pipeline A, then Pipeline B got triggered and use buildVersionToDownload: $(Revision) to download build artifacts.