Pass variable from 1 job to other job with seperate jenkinsfiles

11 views
Skip to first unread message

Werner Dijkerman

unread,
Aug 29, 2017, 4:29:23 PM8/29/17
to Jenkins Users
Hi,

I have an issue and I don't get it to work.

I have 2 Jenkinsfiles and thus 2 jobs. With the first Jenkinsfile I set an variable by reading a specific file, in this case: def commit_id = readFile('.git/commit-id').trim()
Now I need to pass this 'commit_id' variable from the 1st Jenkinsfile/job to the 2nd Jenkinsfile/job. The 2nd job will already be triggered once the 1st job is completed successfully.

I Already have installed the 'Parameterized Trigger plugin' plugin and added a "string" parameter (Name: commid_id, value: {commit_id}) but this isn't working.

What am I doing wrong? Any suggestions?

Kind regards,
Werner

Michael Pailloncy

unread,
Aug 29, 2017, 4:44:08 PM8/29/17
to jenkins...@googlegroups.com
Hey. IIUC, this should be possible. Can you show us the content of your Jenkinsfiles please ? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b3b7aa55-f9e4-45dd-abb8-05dd213b5b13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages