I will look into using Workflow instead of Matrix. Looks also that Workflows is a big thing in the coming Jenkins 2.0.
I have previously submitted a feature request for matrix plugin to support pre-build step. https://issues.jenkins-ci.org/browse/JENKINS-30792 tirsdag 8. desember 2015 07.41.08 UTC+1 skrev Baptiste Mathus følgende: > > > Le 7 déc. 2015 1:05 PM, "Sverre Moe" <[email protected] <javascript:>> a > écrit : > > > > I have several projects of type Multi-Configuration. When a project > starts a build I have a need to trigger builds of other projects (under > certain conditions) before any of the configurations are started. However I > cannot see how it would be possible. > > > > I have a rather complex workflow: > > 1) A new change in ProjectA. After success and all of its configurations > are finished, it triggers a build of all its downstream dependencies. If > any of them fails then the upstream project should also fail. > > > > 2) A new change in one of ProjectA downstream projects, lets call it > ProjectB. Now, before ProjectB can start building each of its > configurations I need to trigger build of ProjectA, otherwise ProjectB > would be built with the previous version of ProjectA. When ProjectA has > built it will again trigger all of its downstream dependencies, except for > ProjectB which is already running (waiting for ProjectA to finish with > SUCCESS). > > > > I have implemented a Groovy script to perform step 1, but I have > problems with finding a solution how to implement a solution for step 2. > > I could execute a system groovy script in the build step, but that will > trigger a build of ProjectA for each configurations. Would be able to solve > this if I could run that groovy script in a pre-build-step, but none exist > for Multi-configuration project. > > > > I do not want to abandon Multi-Configuration project type, but perhaps I > would need to use a different project type that will allow me more control > of the workflow. > > IMO you nailed it. What you have really seems like a (complex) workflow, > hence I think you should try the workflow plugin. > > You even say above you wrote some groovy for all that, you might be able > to reuse party of it or at least use it as a basis. (Workflow is using a > /special/ groovy) > > > Perhaps a Workflow project type. It would be last resort because I have > put a lot of work in the setup I have now. > > I understand, but IMO this can only get worse in terms of efforts to > adding things. Might be a signal to make a checkpoint to consider changing > the whole thing into a hopefully more readable and manageable thing. > > The alternative might be you see how to contribute/add a pre-scm step to > matrix. > > My 2 cents > > Cheers > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6e0ef4be-e576-4fb7-89c8-92a1851734ba%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
