diff --git a/Test/Jenkinsfile b/Test/Jenkinsfile index 4f3a7f6..b324a6c 100644 --- a/Test/Jenkinsfile +++ b/Test/Jenkinsfile @@ -178,8 +178,21 @@ properties([ ) ]) +// Packages that are Architecture: all only are built on any executor (built-in +// node with its many slots, or Kubernetes executors); waiting for the single +// arm64 drone gains nothing for them. Anything architecture-dependent keeps +// the arm64 pin. +def onBuildNode(String label, Closure body) { + if (label) { + node(label) { body() } + } else { + node { body() } + } +} + def scmVars = [:] -node('arm64') { +String buildLabel = 'arm64' +node() { ansiColor('xterm') { stage('SCM Checkout') { // Run the one github.com checkout of this build on node-local disk, @@ -193,6 +206,12 @@ node('arm64') { // never contact github.com again on this node. scmVars = checkout scm seedNodeMirror(root, scmVars.GIT_URL, scmVars.GIT_COMMIT, pwd()) + def archs = sh( + script: "awk '/^Architecture:/ { for (i = 2; i <= NF; i++) print \$i }' debian/control | sort -u", + returnStdout: true + ).trim() + buildLabel = (archs == 'all') ? '' : 'arm64' + println "Architectures: ${archs.replace('\n', ' ')} -> build node: ${buildLabel ?: 'any executor'}" } } } @@ -214,7 +233,7 @@ distributions.each { distro -> def artifacts = [] def buildVer = '' - node('arm64') { + onBuildNode(buildLabel) { ansiColor('xterm') { def root = nodeLocalRoot() def buildId = localBuildId(distroCode)