Created
October 31, 2017 16:02
-
-
Save gibfahn/02221043ee5fce85e33d24794a47731c to your computer and use it in GitHub Desktop.
citgm-continuous-integration-pipeliner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println "\n### BUILD PARAMETERS ###" | |
def pr = [] // Mutable parameter set to pass to jobs. I know this is crazy. | |
String printParams = '' // String of params to print | |
for (param in params) { | |
printParams += param.toString() + '\n' | |
if (param.key != 'NODE_VERSIONs') { | |
pr.push(string(name: param.key, value: param.value)) | |
} | |
} | |
println printParams | |
stage('Test citgm') { | |
def versions = params['NODE_VERSIONs'].split() | |
def buildJobs = [:] | |
for (int i = 0; i < versions.length; i++) { | |
int index = i // locally scoped copy. | |
def p = pr.collect() // local copy of params | |
p.push(string(name: 'NODE_VERSION', value: versions[index])) | |
buildJobs["${versions[index]}"] = { build(job: 'citgm-continuous-integration', parameters: p) } | |
} | |
println buildJobs | |
parallel(buildJobs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment