Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.