Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing build parameters downstream using groovy. Jenkins build pipeline

Tags:

jenkins

groovy

I've seen a number of examples that execute a pre build system groovy script to the effect of

import hudson.model.*
def thr = Thread.currentThread()
def build = thr?.executable
printf "Setting SVN_UPSTREAM as "+ build.getEnvVars()['SVN_REVISION']  +"\n" ; 
build.addAction(new ParametersAction(new StringParameterValue('SVN_UPSTREAM', build.getEnvVars()['SVN_REVISION'])))

Which is intended to make SVN_UPSTREAM available to all downstream jobs.

With this in mind I attempt to use $SVN_UPSTREAM in a manually executed downstream job like

https://code.mikeyp.com/svn/mikeyp/client/trunk@$SVN_UPSTREAM

Which is not resolved causing an error.

Can anyone spot the problem here?

like image 596
MikePatel Avatar asked Jan 22 '26 11:01

MikePatel


1 Answers

The bleeding edge jenkins build pipeline plugin now supports parameter passing. Eliminated the need for the groovy workaround for me.

like image 90
MikePatel Avatar answered Jan 24 '26 12:01

MikePatel