#!groovy def specToLabel(Map spec) { return "${spec.os}-${spec.arch}-${spec.compiler}-FairSoft_${spec.fairsoft}" } def buildMatrix(List specs, Closure callback) { def nodes = [:] for (spec in specs) { def label = specToLabel(spec) nodes[label] = { node(label) { try { deleteDir() checkout scm callback.call(spec, label) deleteDir() } catch (e) { deleteDir() throw e } } } } return nodes } pipeline{ agent none triggers { cron('H 2 * * *') } stages { stage("Run Nightly Build/Test Matrix") { steps{ script { parallel(buildMatrix([ [os: 'Debian8', arch: 'x86_64', compiler: 'gcc4.9', fairsoft: 'may18'], [os: 'MacOS10.11', arch: 'x86_64', compiler: 'AppleLLVM8.0.0', fairsoft: 'may18'], [os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM9.0.0', fairsoft: 'may18'], ]) { spec, label -> sh '''\ echo "export BUILDDIR=$PWD/build" >> Dart.cfg echo "export SOURCEDIR=$PWD" >> Dart.cfg echo "export PATH=$SIMPATH/bin:$PATH" >> Dart.cfg echo "export GIT_BRANCH=dev" >> Dart.cfg ''' sh './Dart.sh Nightly Dart.cfg' sh './Dart.sh Profile Dart.cfg' }) } } } } }