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 } } } stage('Build apps(s) 2') { steps { script { parallel jobs } } } stage('Build apps(s) 3') { steps { script { parallel jobs } } } } }