echo "clean: ${clean}"
node("qisrc") {
echo "clean: ${clean}"
if (clean) {
sh "echo clean"
}
sh "echo build"
}
Running: Print Message clean: false Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow Running: Allocate node : Body : Start Running: Print Message clean: false Running: Shell Script [workflow] Running shell script + echo clean clean Running: Shell Script [workflow] Running shell script + echo build build Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Finished: SUCCESS
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/48dbdae4-beae-4004-a44a-5f5ffcd30eeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Remember that in groovy
if ("false") {
println("Hello world")
}
But isn't that a bug? Why doesn't the surrounding code cast the parameter to a Boolean value, as certainly I would expect?
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a5c46e5e-6dec-4736-ba5d-4653f2da7695%40googlegroups.com.
No, it is how the groovy truth is defined. See http://docs.codehaus.org/display/GROOVY/Groovy+TruthNon-empty strings are coerced to true, even if the value is "false".
2015-02-20 6:11 GMT+01:00 Jos Backus <j...@catnook.com>:But isn't that a bug? Why doesn't the surrounding code cast the parameter to a Boolean value, as certainly I would expect?
why is the variable created by a "Boolean Build Parameter" (from the top of the job configuration page) not a boolean variable in the first place?
I guess is has something to do with compatibility with non-workflow jobs, which access the parameter as an environment variable (instead of a groovy variable)