Reputation: 1565
Matrix plugin allows us doing multi-dimensional builds based on some user-defined or built-in axes. However when we trigger the matrix build, Jenkins starts build for all cartesian product builds. QUESTION: I wonder is there a way to trigger a build for a single matrix entry or am I on a wrong path?
Some visualization:
axis 1 variables (branch) -> master branch1 branch2
axis 2 variables (app type) -> api web
axis 3 variables (deploy target) -> test stage live
In this specific case jenkins comes up with a 3-dimensional cube of jobs containing 3x2x3=18 builds in it, and when I trigger build that matrix project all of them starts. What I want here is, I should able to select axis variable for each axis (ie from multiselect list), and based on those selections jenkins should build only corresponding items. For instance;
axis 1 -> branch1
axis 2 -> api
axis 3 -> test stage
Hence jenkins should execute only 2 jobs.
Upvotes: 2
Views: 760
Reputation: 9075
You want the Matrix Combination Plugin which will prompt you for the combinations you want
This plugin allows a user to choose which matrix combinations he wants to run, as opposed to the default behaviour where jenkins runs all combinations: Using:
After clicking the build, the user gets a html table with a checkbox for each matrix combination.
After clicking the submit button, only checked combinations will run.
Upvotes: 2