Remove parallel blocks. Try with loops at stage level.
This commit is contained in:
parent
fb4b0ec1a3
commit
7c74ee67cb
|
@ -55,25 +55,6 @@ echo "Release number: ${params.gCube_release_number}"
|
||||||
|
|
||||||
def components = gcubeJSON['Components']
|
def components = gcubeJSON['Components']
|
||||||
|
|
||||||
def dynamicStages = [:]
|
|
||||||
|
|
||||||
//let's build the stages closures
|
|
||||||
components.each { entry -> echo "App name: $entry.key = Jobs: $entry.value" }
|
|
||||||
components.each { entry ->
|
|
||||||
def app = entry.key
|
|
||||||
dynamicStages["stage-${app}"] = ["${app}":{
|
|
||||||
node {
|
|
||||||
stage("Build ${app}") {
|
|
||||||
for (int j = 0; j < entry.value.size(); j++) {
|
|
||||||
build "${entry.value[j]}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Configured dynamic stages: ${dynamicStages.inspect()}"
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
// see https://jenkins.io/doc/book/pipeline/syntax/#agent
|
// see https://jenkins.io/doc/book/pipeline/syntax/#agent
|
||||||
agent any
|
agent any
|
||||||
|
@ -114,22 +95,33 @@ pipeline {
|
||||||
stage('Build SmartGears components') {
|
stage('Build SmartGears components') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
parallel dynamicStages['stage-SmartGears']
|
for(int job=0; i < components['SmartGears'].size(); job++) {
|
||||||
|
stage(components['SmartGears'][job]){
|
||||||
|
build "${components['SmartGears'][$job]}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build enabling components') {
|
stage('Build Enabling components') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
parallel dynamicStages['stage-Enabling']
|
for(int job=0; i < components['Enabling'].size(); job++) {
|
||||||
|
stage(components['Enabling'][job]){
|
||||||
|
build "${components['Enabling'][$job]}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Build Data components') {
|
||||||
stage('Build data components') {
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
parallel dynamicStages['stage-Data']
|
for(int job=0; i < components['Data'].size(); job++) {
|
||||||
|
stage(components['Data'][job]){
|
||||||
|
build "${components['Data'][$job]}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue