0
votes

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://docs.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://docs.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.

1
this is weird, I would expect this to be available on all the steps, but I dont see this in the docs4c74356b41
Continued digging on this and found it needs refName setting but this doesn't seem possible in yaml.John Metcalfe

1 Answers

0
votes

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.