Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins workflow job: Use parameter as branch specifier

I want to migrate our old free style dev builds, in which we use the branch name as a build parameter, to workflow builds. This works fine so far, the only thing we are really missing is the ability to use the parameter, e.g. "branch_name", as the branch specifier for the Workflow script from SCM section. On a free style build this works fine. Any ideas how this could be achieved? We don't want a dev to change the configuration all the time before starting a build.

like image 785
MBeck Avatar asked Dec 22 '15 13:12

MBeck


1 Answers

Try to disable "Lightweight checkout" checkbox.

Lightweight checkout screenshot

This behavior is noted when clicking the help question mark for the "Lightweight checkout" option:

Also build parameters will not be substituted into SCM configuration in this mode.

Found that in latest comments of JENKINS-28447

like image 144
Mikalai Parafeniuk Avatar answered Sep 19 '22 21:09

Mikalai Parafeniuk