Jenkinsfile: Allow specifying packaging targets.

The default is to build all the packaging targets (minus the *_qt
and *_arm ones).  Add a PACKAGING_TARGETS parameter that allows
specifying which targets to build.

* Jenkinsfile: (PACKAGING_TARGETS): New parameter.
('Build packages'): Use it unless it's the empty string.

GitLab: jami-packaging#98
Change-Id: Idf1b4460a0edac7cbe6a82b9db1d204af78de801
parent 7138430e
......@@ -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 ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment