Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crpietschmann/35c950732844f077ce07233811f8b86d to your computer and use it in GitHub Desktop.
Save crpietschmann/35c950732844f077ce07233811f8b86d to your computer and use it in GitHub Desktop.
Azure DevOps Variables - pass variable from on job to another
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