Matrix project axis creation and exclusion plugin using yaml file
Usage
1. Add yaml file to repository
example
# axis.yml
RUBY_VERSION:
- 2.1.8
- 2.2.4
- 2.3.0
exclude:
- RUBY_VERSION: 2.1.8
- RUBY_VERSION: 2.3.0
DATABASE: oracle
2. Create Multi-configuration project
3. Configuration Axis
Choose Yaml Axis
Input configurations
- Axis yaml file : Yaml file path (relative path from workspace or absolute path)
- Axis name : Top key in yaml file
You can combine Yaml Axis and other axes
4. Configuration Execution Strategy
Choose "Yaml matrix execution strategy" at Execution Strategy
If you don't want to exclusion, choose Classic
Input settings
Example 1 (Use yaml file)
Example 2 (Use yaml text)
4. Build job
Generate yaml based matrix and run job
- blue is executed job
- gray is excluded(skipped) job
Detail
Excluding logic
Excluding pattern may be specified with List
of Map
(e.g. List<Map<String, [String or List]>>
)
Elements in the Map
may be a List to exclude multiple items for one key
# axis.yml
exclude:
- RUBY_VERSION: 2.1.8
- RUBY_VERSION: 2.3.0
DATABASE: oracle
When specified 2 axes
This results in a 3x3 build matrix.
- When specified
RUBY_VERSION
value2.1.8
, 3 results are excludedRUBY_VERSION
value2.1.8
andDATABASE
valuemysql
is excludedRUBY_VERSION
value2.1.8
andDATABASE
valuepostgres
is excludedRUBY_VERSION
value2.1.8
andDATABASE
valueoracle
is excluded
- When specified
RUBY_VERSION
value2.3.0
andDATABASE
valueoracle
, 1 result is excludedRUBY_VERSION
value2.3.0
andDATABASE
valueoracle
is excluded
Another example
# axis2.yml
exclude:
- RUBY_VERSION: 2.1.8
- RUBY_VERSION: 2.3.0
DATABASE:
- oracle
- mysql
- When specified
RUBY_VERSION
value2.1.8
, 3 results are excludedRUBY_VERSION
value2.1.8
andDATABASE
valuemysql
is excludedRUBY_VERSION
value2.1.8
andDATABASE
valuepostgres
is excludedRUBY_VERSION
value2.1.8
andDATABASE
valueoracle
is excluded
- When specified
RUBY_VERSION
value2.3.0
, 2 results are excludedRUBY_VERSION
value2.3.0
andDATABASE
valueoracle
is excludedRUBY_VERSION
value2.3.0
andDATABASE
valuemysql
is excluded
Final example
Using multiple lists will exclude the cartesian product of those lists.
# axis3.yml
exclude:
- RUBY_VERSION:
- 2.1.8
- 2.3.0
DATABASE:
- oracle
- mysql
- 4 results are excluded
RUBY_VERSION
value2.1.8
andDATABASE
valuemysql
is excludedRUBY_VERSION
value2.1.8
andDATABASE
valueoracle
is excludedRUBY_VERSION
value2.3.0
andDATABASE
valueoracle
is excludedRUBY_VERSION
value2.3.0
andDATABASE
valuemysql
is excluded