I came by an immediate fix:

Using this Groovy Postbuild script on all my jobs

import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixRun;

if (manager.buildIsA(MatrixBuild.class)) {
    evaluate(new File("build-downstream-projects.groovy"))
}


A little bit duplication, but the main logic remains in the groovy script 
file.


onsdag 18. mars 2015 12.24.23 UTC+1 skrev Sverre Moe følgende:
>
> 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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7066c141-1e76-46e3-87f6-8774992b6ec3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to