Thanks for the help Chris! This worked perfectly (used the multiple
subset example from then end of your reply). Just one minor note (if
anyone comes across this and wants to do it...

This form doesn't work... I was getting an error when I used this in
my initial attempt:
 (${SUBSET}=="Set1" && <subset1 expression>) || (${SUBSET}=="Set2" &&
<subset2 expression>) || (${SUBSET}=="Set3" && <subset3 expression>)

But by changing it to (quoting the ${SUBSET} expressions):
 ("${SUBSET}"=="Set1" && <subset1 expression>) || ("${SUBSET}"=="Set2"
&& <subset2 expression>) || ("${SUBSET}"=="Set3" && <subset3
expression>)

It worked like a charm.

Thanks again for the assistance!

Ben

On Fri, Aug 31, 2012 at 10:27 AM, cjo <cjo.john...@gmail.com> wrote:
> The groovy filter expression is the same as you would specify in Combination
> filter of the matrix job
> and is applied on top of the combination filteer already set for the matrix
> job.
>
> So as you have 3 axis with multiple items.
> e.g.
>
> TARGET = target_a, target_b
> SIGNING = release, development
> PRODUCT = Product_1, ... Product_15
>
> The combination filter to build just Product_5 for all targets and signing
> would be
> (PRODUCT=="Product_5")
>
> or to build just product 5 for development
> (PRODUCT=="Product_5" && SIGNING=="development")
>
> The combination filter in the matrix job should be set so that only the
> valid configurations can be built,
> as when it is triggered from the upstream job using the Matrix Subset
> parameter it will be combined together.
> If all of the combinations of the Axis are valid you do not need to set the
> combination filter.
>
> Now if you start the job with a Matrix subset parameter you can define which
> axis combinations should be built,
>
> So if the combination filter on the matrix job is set to build just
> Product_5 and Product_10 for all targets and signings
> (PRODUCT=="Product_5" || PRODUCT=="Product_10") - this would produce 8
> combinations.
>
> To limit this just Product_5 and development, you would trigger the build
> with the this combination
> (PRODUCT=="Product_5" && SIGNING=="development")
>
> Which would produce 2 builds rather than the default 8 builds.
>
>
> So if your 2x2x15 is the full set with no combination filter, then you can
> just run that as normal,
> and if you want the smaller 2x2x1 set you would start that with a matrix
> subset parameter.
>
>
> If you dynamically want to set this from an upstream job, I would suggest
> having the following groovy expression
>
> (${ALL} || <restricted subset expression>)
>
> which means that you can have env property injected into the build as for
> ALL="true" to build all of the matrix and set it to false to build the
> subset.
> I tested this by just using a boolean parameter on the upstream build.
>
> Note: you can't just export the Value in a shell, as you need to add it to
> the Jenkins build Environment. (use the EnvInject plugin if needed.)
>
> Of course the expressions can be made as complex as you like depending on
> your needs.
> e.g. selecting one of three subsets could be done as
> (${SUBSET}=="Set1" && <subset1 expression>) || (${SUBSET}=="Set2" &&
> <subset2 expression>) || (${SUBSET}=="Set3" && <subset3 expression>)
>
> Chris
>
> On Friday, August 31, 2012 4:36:16 PM UTC+1, benjamin.a.lau wrote:
>>
>> I was able to update sooner. So this uses a groovy statement to deal
>> with the combination... how exactly would this work? And how would I
>> make use of a parameter on the build doing the triggering to decide
>> which of two combinations to use?
>>
>> Do you have an example I could look at?
>>
>> Ben
>>
>> On Fri, Aug 31, 2012 at 7:11 AM, Benjamin Lau <benjami...@gmail.com>
>> wrote:
>> > Haha... I'm currently running 2.13... so close. ;-)
>> >
>> > I'll update tonight since the day's builds are just starting. Jenkins
>> > was in need of a maintenance cycle anyway.
>> >
>> > Thanks!
>> >
>> > Ben
>> >
>> > On Fri, Aug 31, 2012 at 4:42 AM, cjo <cjo.j...@gmail.com> wrote:
>> >> Use the parameterized trigger plugin, as that has a parameter to pass
>> >> in
>> >> matrix subset to build, using that combination rather than the defined
>> >> one
>> >> in the project.
>> >> Added in 2.14.
>> >>
>> >>
>> >>
>> >> https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin
>> >>
>> >> Chris
>> >>
>> >>
>> >> On Thursday, August 30, 2012 5:23:04 PM UTC+1, benjamin.a.lau wrote:
>> >>>
>> >>> Hello,
>> >>>
>> >>> Say I've got a matrix job with 2x2x15 jobs. For some builds I would
>> >>> like to have this run as a 2x1x1 matrix instead. Is there an easy way
>> >>> to change the job's combination filter via a parameter or something
>> >>> like that? I tried passing in the combination filter as a build
>> >>> parameter, but I don't think it can handle parsing a parameter
>> >>> variable definition.
>> >>>
>> >>> Baring that... is there a way I could programatically update the job
>> >>> from another job?
>> >>>
>> >>> Thanks in advance,
>> >>>
>> >>> Ben

Reply via email to