diff --git a/Jenkinsfile b/Jenkinsfile index 08c453d6f71fe60be244269e1a8a1798af4ee730..c1a47c5749637b04b213ba4fa07cab0900b9bf77 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,13 +12,18 @@ pipeline { string(name: 'GERRIT_REFSPEC', defaultValue: 'refs/heads/master', description: 'The Gerrit refspec to fetch.') - booleanParam(name: 'BUILD_OWN_QT', defaultValue: false, description: 'Whether to build our own Qt packages.') booleanParam(name: 'BUILD_ARM', defaultValue: false, description: 'Whether to build ARM packages.') + string(name: 'PACKAGING_TARGETS', + defaultValue: '', + description: 'A whitespace-separated list of packaging ' + + 'targets, e.g. "package-debian_10 package-snap". ' + + 'When left unspecified, all the packaging targets are built.') + } environment { @@ -68,15 +73,20 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration" } steps { script { - def targetsText = sh(script: 'make -s list-package-targets', - returnStdout: true) - def targets = targetsText.split('\n') + def targetsText = params.PACKAGING_TARGETS.trim() + if (!targetsText) { + targetsText = sh(script: 'make -s list-package-targets', + returnStdout: true).trim() + } + + def targets = targetsText.split(/\s/) if (!params.BUILD_OWN_QT) { targets = targets.findAll { !it.endsWith('_qt') } } if (!params.BUILD_ARM) { targets = targets.findAll { !(it =~ /_(armhf|arm64)$/) } } + def stages = [:] targets.each { target ->