Skip to content
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

Merged
merged 1 commit into from
Jun 19, 2017
Merged

Conversation

jpricket
Copy link
Member

@jpricket jpricket commented Jun 19, 2017

  • 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

Copy link
Contributor

@jeffyoung jeffyoung left a 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.

Copy link
Contributor

@davidstaheli davidstaheli left a 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());
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

"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."
Copy link
Contributor

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".

Copy link
Member Author

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.

@jpricket jpricket force-pushed the users/jpricket/jenkins3 branch from b1f8402 to 4cf7c42 Compare June 19, 2017 15:42
@jpricket jpricket merged commit 9b566c9 into master Jun 19, 2017
@jpricket jpricket deleted the users/jpricket/jenkins3 branch June 19, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants