The groovy script executed by Groovy Postbuild does not run on Matrix
parent if this Post build publisher comes from a template project.
There is an issue for this:
https://issues.jenkins-ci.org/browse/JENKINS-27317
I order for the script to run on my several hundred jobs I would have to
duplicate this script under each job. Maintenance would be a nightmare.
Thankfully Execute System Groovy script could load the script from a file,
thus I solve my script duplication problem. It exposes some of the same
variables as Groovy Postbuild, such as the current build. However I cannot
get the script to run only on Matrix parent
Build -> Execute System Groovy script -> Script command
import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixRun;
if (build instanceof MatrixRun) {
println "MatrixRun child"
} else if (build instanceof MatrixBuild) {
println "MatrixBuild parent"
}
It seems it only runs on each matrix build configurations (childs).
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/30a70a84-dfce-49fe-91b1-602d995ce406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.