I have a pipeline in Azure DevOps that essentially look like this
stage: BuildStage
job: SetUp
job: Compile
stage: DeployStage
job: Deploy
In the SetUp
job I define an output variable, which I can define in the Compile
job using e.g.
variables:
MyVariableFromSetUp: $[ dependencies.SetUp.outputs['MyVariable'] ]
The question is, how can I do the same in the Deploy job? I don't want to run the SetUp stage twice as it is time consuming to calculate the value of MyVariable
hence I must cache it.
The DeployStage has a dependsOn to BuildStage, but it appears I cannot use the dependencies
as I expected. The documentation fails to mention the multi-stage case when dealing with variables.