Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve jenkins build pipeline number?

In Jenkins I would like to build my test environment based on the "Build Pipeline Number" to make tests and deployment repeatable (on the same source version), but I didn't find any environment variable to retrieve this number. I tried to use the BUILD_ID but it is different for each job (downstream project).

Is it possible to retrieve the Build Pipeline Number? Or is there any other control number that I can use that is the same for all the jobs (increases on a new build)?

like image 534
faersons Avatar asked Dec 02 '25 18:12

faersons


1 Answers

If you are using the less popular Delivery pipeline plugin there is a PIPELINE_VERSION environment variable. Otherwise, with the Build pipeline plugin you would probably have to use your VCS revision number and pass it downstream with Parameterized Trigger Plugin

If you would like to see the list of all current available environment variables just run a batch command SET from your build step (or if linux in shell env)

like image 118
Cole9350 Avatar answered Dec 05 '25 02:12

Cole9350



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!