jenkinsci / jenkinsci/matrix-project-plugin
[JENKINS-62773] Allow for nesting Parallel and Matrix blocks
- Dominant language
- Java
- Stars
- 17
- Forks
- 85
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 5
Description
Apologies if this is a duplicate, but I couldn't find another ticket.
I'd like to create a job that runs a standalone stage, and a matrix based stage, in parallel. Below is an example of what I'm thinking. The AWS job has different steps / params, so it would be run in parallel to the matrix build, which has several more variants.
When running the below, the build stops, and tells me `"matrix" or "parallel" cannot be nested inside another "matrix" or "parallel"`.
stage('Build Images') {
parallel {
stage ('Build AWS') {
steps {
echo "Running AWS Clone Packer Job"
sh 'doing stuff'
}
}stage('Build vCenter') {
matrix {
axes {
axis {
name 'DC'
values 'DC1', 'DC2'
}
axis {
name 'DB'
values 'DB1', 'DB2'
}
axis {
name 'TENNANTS'
values 'ST', 'MT'
}
}
}
steps {
echo "Running vCenter Clone Packer Job"
sh "doing something in a matrix"
}
}
}
}
---
Originally reported by herocc, imported from: Allow for nesting Parallel and Matrix blocks
Raw content of original issue
Apologies if this is a duplicate, but I couldn't find another ticket.
I'd like to create a job that runs a standalone stage, and a matrix based stage, in parallel. Below is an example of what I'm thinking. The AWS job has different steps / params, so it would be run in parallel to the matrix build, which has several more variants.
When running the below, the build stops, and tells me `"matrix" or "parallel" cannot be nested inside another "matrix" or "parallel"`.
stage('Build Images') {
parallel {
stage ('Build AWS') {
steps {
echo "Running AWS Clone Packer Job"
sh 'doing stuff'
}
}stage('Build vCenter') {
matrix {
axes {
axis {
name 'DC'
values 'DC1', 'DC2'
}
axis {
name 'DB'
values 'DB1', 'DB2'
}
axis {
name 'TENNANTS'
values 'ST', 'MT'
}
}
}
steps {
echo "Running vCenter Clone Packer Job"
sh "doing something in a matrix"
}
}
}
}
- environment:
CloudBees Core Managed Master 2.204.3.7
Contributor guide
Research direction
Start by examining the matrix-project-plugin, pipeline-model-definition-plugin, and workflow-cps-plugin components and trace the validation that produces the nesting error. Use the provided Pipeline example as the behavioral target; done means compatible nested Parallel and Matrix blocks are accepted without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, ci-cd
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100