This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-26194] Noting default environment variables and parameters.
- Loading branch information
d3e64f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an excellent addition to the tutorial. It would be nice to have a more clear example on how to use the build number in flow.groovy. I posted a question to Jenkins' Google groups on it: post
d3e64f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And is there a way to access to the list or array of input parameters to iterate over it?
d3e64f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perrefe has a point here: it's obvious that one can do amazing things with CPS, but especially advanced Jenkins users who know Matrix Build, or other multi configuration techniques, well need some guidance for rewriting their solutions as CPS scripts. As long as there are open collection/list/string handling, or CPS transformation issues, this is of some importance (e.g. JENKINS-26307, JENKINS-27893, JENKINS-27916, JENKINS-27421).
Ah, yes, the question... to access an array of input parameters, make it a delimited string, and spIit it (like in the parallel test execution example) :-)
d3e64f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick!, but in my actual scenario I have a set of boolean parameters (names of servers, and yes, I could enter their names comma separated but it is not practical at all.) where each one represent a server that will be affected by the job if the input checkbox is checked. So it should be easy to iterate all those params searching for the ones with true values.
Thanks!