Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How downstream job uses the git commit that is passed by upstream job?

I have two jobs(A and B) that I want to B is triggered by A with the git commit used by A after A is successfully built.

The build trigger plug-in supports trigger the downstream job with the git commit used in the upstream job.

My question is how the downstream job uses the passed in commit to check out. I didn't find which variable is passed by job A, and how to use the pass-in commit value to check out code in B via Git plug-in of Jenkins?

like image 363
Kane Avatar asked Nov 14 '11 02:11

Kane


People also ask

What is upstream and downstream job?

An upstream job is a configured project that triggers a project as part of its execution. A downstream job is a configured project that is triggered as part of a execution of pipeline.

What do you mean by downstream projects & upstream projects in Jenkins?

An upstream project is one in which a job is triggered before the actual project is triggered. Whereas, Downstream project is one in which a job is triggered after the project has been triggered.

How do I find my upstream build number?

You can probably find the last build number with groovy in regards to your upstream build, increment it, and assign that value to a dynamic parameter. That means it would be a number generated at build-queue and as long as it's forwarded downstream, should remain the same when needing to reference it.


1 Answers

Jenkins Git plug-in is an intelligent tool. No specific configuration is needed. In upstream job trigger the downstream job with the Git commit used by the upstream job, downstream will automatically checkout the commit passed in by upstream.

like image 167
Kane Avatar answered Oct 26 '22 16:10

Kane