Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Require a downstream job to use the same commit as its parent

Tags:

git

jenkins

If job "B" is downstream of job "A" and both draw from the same git repository, how can one ensure that the build of B triggered by a build of A uses the same commit, even if new commits have been made to the repository while "A" was building?

The answer to this post suggests using the copy-artifact plugin, but it seems like there ought to be an easier way to just instruct job "B" to "use this exact commit hash for this build."

like image 789
gcbenison Avatar asked Nov 03 '22 20:11

gcbenison


1 Answers

You need the parameterized trigger plugin for jenkins, installed along the Git plugin that you probably already have installed. It allows to specify Git SHA1 commit id for next build as predefined parameter.

like image 171
guido Avatar answered Nov 09 '22 15:11

guido