gCubeBuilder/examples/dynamic_parallel_nested

47 lines
1.1 KiB
Plaintext
Raw Normal View History

def apps = "maven-parent,gcube-bom,gx-rest"
def applications = apps.split(",").findAll { it }.collect { it.trim() }
def environment = env.ENVIRONMENT
def version = env.VERSION
def jobs = [:]
if (applications.size() < 1) {
error("ERROR: APPLICATIONS must be a comma-delimited list of applications to build")
}
for (int i = 0; i < applications.size(); i++) {
def app = applications[i]
jobs["jobs-${app}"] = {
node {
stage("Build ${app}") {
build "${app}"
}
}
}
}
// the problem is with more than ONE parallel block
pipeline {
agent any
stages {
stage('Build apps(s)') {
steps {
script {
parallel jobs
}
}
}
2019-09-01 04:01:43 +02:00
stage('Build apps(s) 2') {
steps {
script {
parallel jobs
}
}
}
stage('Build apps(s) 3') {
steps {
script {
parallel jobs
}
}
}
}
}