Skip to content
Snippets Groups Projects
Unverified Commit 854d54ba authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -12,13 +12,18 @@ pipeline { ...@@ -12,13 +12,18 @@ pipeline {
string(name: 'GERRIT_REFSPEC', string(name: 'GERRIT_REFSPEC',
defaultValue: 'refs/heads/master', defaultValue: 'refs/heads/master',
description: 'The Gerrit refspec to fetch.') description: 'The Gerrit refspec to fetch.')
booleanParam(name: 'BUILD_OWN_QT', booleanParam(name: 'BUILD_OWN_QT',
defaultValue: false, defaultValue: false,
description: 'Whether to build our own Qt packages.') description: 'Whether to build our own Qt packages.')
booleanParam(name: 'BUILD_ARM', booleanParam(name: 'BUILD_ARM',
defaultValue: false, defaultValue: false,
description: 'Whether to build ARM packages.') 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 { environment {
...@@ -68,15 +73,20 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration" ...@@ -68,15 +73,20 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration"
} }
steps { steps {
script { script {
def targetsText = sh(script: 'make -s list-package-targets', def targetsText = params.PACKAGING_TARGETS.trim()
returnStdout: true) if (!targetsText) {
def targets = targetsText.split('\n') targetsText = sh(script: 'make -s list-package-targets',
returnStdout: true).trim()
}
def targets = targetsText.split(/\s/)
if (!params.BUILD_OWN_QT) { if (!params.BUILD_OWN_QT) {
targets = targets.findAll { !it.endsWith('_qt') } targets = targets.findAll { !it.endsWith('_qt') }
} }
if (!params.BUILD_ARM) { if (!params.BUILD_ARM) {
targets = targets.findAll { !(it =~ /_(armhf|arm64)$/) } targets = targets.findAll { !(it =~ /_(armhf|arm64)$/) }
} }
def stages = [:] def stages = [:]
targets.each { target -> targets.each { target ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment