Skip to content

Instantly share code, notes, and snippets.

@jonico
Created February 19, 2018 16:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jonico/5e82177e984bcbb570b19adb2a049adb to your computer and use it in GitHub Desktop.
Save jonico/5e82177e984bcbb570b19adb2a049adb to your computer and use it in GitHub Desktop.
Abbreviated Jenkinsfile to build on multiple archs (from conan.io project)
for (x in slaves) {
def slave = x
for (y in pyvers) {
def pyver = y
builders["${slave} - ${pyver}"] = {
node(slave) {
stage("${slave} - ${pyver}"){
step ([$class: 'WsCleanup'])
checkout scm
def bn = env.BUILD_NUMBER
...
if(slave == "Linux"){
docker.image('lasote/conantests').inside("-e CONAN_USER_HOME=${WORKSPACE}") {
sh(script: "python ${runner} ${modules} ${pyver} ${branch} ${workdir} --num_cores=${numcores}")
}
}
else if(slave == "Windows"){
...
withEnv(["CONAN_TEST_FOLDER=${workdir}"]){
bat(script: "python ${runner} ${modules} ${pyver} ${branch} \"${workdir}\" --num_cores=${numcores}")
}
...
}
else if(slave == "Macos"){
...
withEnv(['PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin']) {
sh(script: "python ${runner} ${modules} ${pyver} ${branch} ${workdir} --num_cores=${numcores}")
}
...
}
}
}
}
}
}
parallel builders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment