I want to pass the git change set information that is checked out of a multi-branch pipeline job to a downstream job that runs the test of this build and sends an email to committers if the build is broken after the test, is there anyway to do this?
Asked
Active
Viewed 418 times
-2
-
What’s a “downstream job”? – evolutionxbox May 24 '19 at 13:31
-
@evolutionxbox A downstream job is one built by the first pipeline job. – zstring May 24 '19 at 14:41
-
Possible duplicate of [Git Variables in Jenkins Workflow plugin](https://stackoverflow.com/questions/35554983/git-variables-in-jenkins-workflow-plugin) – Nick Holt May 24 '19 at 21:36
1 Answers
0
This has been answer here: Git Variables in Jenkins Workflow plugin
After you have the Git variables you can just pass them as standard parameters between jobs.
--- Update ---
An example build call might be:
build job: 'Trial_Test_Pipe',
parameters: [string(name: 'GIT_BRANCH', value: ${GIT_BRANCH}),
string(name: 'GIT_COMMIT', value: ${GIT_COMMIT}),
string(name: 'GIT_COMMITTER_NAME', value: ${GIT_COMMITTER_NAME)]

Nick Holt
- 158
- 1
- 10
-
When you say pass them as standard parameters do you mean string? How do I pass it to a job I call with "build job" – zstring May 28 '19 at 08:48
-
Hi @zstring, yes you could pass them as string parameters from the upstream to the downstream job – Nick Holt May 28 '19 at 09:42