0

I have set up a build and release pipeline in azure DevOps. We currently define the build pipelines as YAML but the release pipelines are set up in the UI due to lack of functionality in the YAML schema.

The task Jenkins queue job has an output variable which gives you the Jenkins Job ID that has been queued.

Setting this in the UI is straightforward, however setting in the YAML schema does not seem possible.

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/build/jenkins-queue-job?view=azure-devops

This image shows the setting of the output variable

This image shows the use of the output variable

I have tried to follow this link:

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch

But do not seem to be able to get it to set the output variable.

Starting to think it may not be available in the Yaml schema as clicking view YAML on the one I have set up in the release pipeline does not show the reference name.

Mohamad Mousheimish
  • 1,641
  • 3
  • 16
  • 48

1 Answers1

0

For this issue, if you want to use JENKINS_JOB_ID as output variable, you can try without setting the reference name.

queue Jenkins job task publishes a output variable JENKINS_JOB_ID. It fetches the current job queued and emits the job id in this variable. you can mention $(xxx_JENKINS_JOB_ID) in the download task. xxx refers to the task name.

All the task output variables are namespaced. The default namespace is the task name.

You can refer to this issue in github for details.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • I've tried this solution but it does not set the output variable. If you have seen it working please let me know. – John Metcalfe Feb 21 '20 at 09:46
  • @John Metcalfe I update the answer , please view it. You can try without setting the reference name in output variable. – Hugh Lin Mar 02 '20 at 10:15