Shan February 2016

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

Answers


acanby February 2016

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!

Post Status

Asked in February 2016
Viewed 2,778 times
Voted 11
Answered 1 times

Search




Leave an answer