Created
May 14, 2020 21:47
-
-
Save crpietschmann/35c950732844f077ce07233811f8b86d to your computer and use it in GitHub Desktop.
Azure DevOps Variables - pass variable from on job to another
This file contains hidden or 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
jobs: | |
- job: JobOne | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- script: | | |
NOW=$( date '+%F_%H:%M:%S' ) | |
echo "time value:" | |
echo $NOW | |
echo "##vso[task.setvariable variable=currentTime;isOutput=true]$NOW" | |
name: getDateStep | |
displayName: Get Date | |
- job: JobTwo | |
dependsOn: JobOne | |
pool: | |
vmImage: 'ubuntu-latest' | |
variables: | |
currentTime: $[ dependencies.JobOne.outputs['getDateStep.currentTime'] ] | |
steps: | |
- script: | | |
echo $(currentTime) | |
displayName: Show Date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment