Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get upstream project info on a downstream project - Jenkins

In Jenkins, if we use Post-Build Trigger to start another build

What are ENVs available to the new build.

I need to identify, parent builds Name, Build Number, Last Successful Artifacts' URL etc.,

In simple words, how to get upstream project info on a downstream project

Is that possible

like image 399
Shan Avatar asked Sep 01 '25 11:09

Shan


1 Answers

You can use the Parameterized Trigger Plugin to pass variables from one build to the next. It is used in much the same way as the Post Build Trigger plugin you mentioned you're using already.

It defines some variables that are passed through to the next job, but you are free to define your own in the box provided, e.g:

ARTEFACT_URL=www.example.com/builds/$BUILD_NUMBER #using another variable from this build
SOMETHING=VALUE
UPSTREAM_BUILD_NAME=myProject
UPSTREAM_BUILD_NUMBER=$BUILD_NUMBER 
#note that you shouldn't override any properties likely to be set in subsequent builds!
like image 121
acanby Avatar answered Sep 04 '25 20:09

acanby