-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding output vars to JenkinsQueueJob task #4585
Conversation
jpricket
commented
Jun 19, 2017
•
edited
Loading
edited
- Since output vars require a new version of the agent, I bumped the major version of the task to 2 (this allows the user to choose when to upgrade)
- This is part of internal user story #982063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Added 2 comments.
@@ -111,6 +111,9 @@ async function doWork() { | |||
var rootJob = await util.pollCreateRootJob(queueUri, jobQueue, taskOptions); | |||
//start the job queue | |||
jobQueue.start(); | |||
//store the job name in the output variable | |||
tl.debug('JENKINS_JOB_ID=' + rootJob.executableNumber); | |||
tl.setVariable("JENKINS_JOB_ID", rootJob.executableNumber.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to double-check, but I think calling setVariable()
already provides debug output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see how the task lib already outputs debug info here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will remove my extra logging.
Tasks/JenkinsQueueJob/task.json
Outdated
"outputVariables" : [ | ||
{ | ||
"name" : "JENKINS_JOB_ID", | ||
"description" : "The id of the Jenkins Job instance queued by this task. Use this variable in the Jenkins Download task to download the artifacts for this particular job instance." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID should be capitalized. Job should be lowercase. "Jenkins Download task" should be "Jenkins Download Artifacts task".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will correct these words.
b1f8402
to
4cf7c42
Compare