33 lines
739 B
Plaintext
33 lines
739 B
Plaintext
|
def apps = "job1,job2,job3,job4"
|
||
|
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}"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
pipeline {
|
||
|
agent none
|
||
|
stages {
|
||
|
stage('Build apps(s)') {
|
||
|
steps {
|
||
|
script {
|
||
|
parallel jobs
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|