Jenkins: find build number for git commit -




each commit git repo triggers build of jenkins pipeline.

i want retrieve buildnumber of old build commit hash. how can that?

i know information exists because can find in ui.


some background why want this: when tags commit want create release (by tagging docker image). each build push image containing build number. want find out build number corresponds commit can find image want release.

if understand question correctly, first need create git hook trigger new build. part covered in answer how react new tags in git hooks?', though if using github, bitbucket or gitlab, there may other ways of going it.

then when build initiated, there build number provided variable 'build_number' ,in jenkins. if want include git tag name, can use in script, there seems fews ways:

typically these plugins create environment variable can consumed scripts. not providing more concrete examples, since not aware of exact tooling.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -