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

ci: Add a Jenkinsfile to build the packages.

The pipeline code is modernized to use the declarative pipeline DSL of
Jenkins, and the GNU/Linux package builds now all share the same
source release archive, which is built from cached contribs tarballs
when available.

GitLab: jami-packaging#55
Change-Id: Id7f37966dd80c36cfa0ebdd461c0ab90505dcd37
parent 01bbc0cc
No related branches found
No related tags found
No related merge requests found
// Packaging validation for supported GNU/Linux systems.
//
// Note: To work on this script without having to push a commit each
// time, use the jenkins-cli command (see:
// https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Usage_CLI_de_Jenkins).
pipeline {
agent {
label 'guix'
}
environment {
TARBALLS = '/opt/ring-contrib' // set the cache directory
}
options {
ansiColor('xterm')
}
stages {
stage('Check configuration') {
when { not { expression { fileExists TARBALLS } } }
steps {
error "The ${TARBALLS} directory does not exist. \
See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration"
}
}
stage('Fetch submodules') {
steps {
echo 'Updating relevant submodules to their latest commit'
sh 'git submodule update --init --recursive --remote' +
'daemon lrc client-gnome client-qt'
}
}
stage('Generate release tarball') {
steps {
// The bundled tarballs included in the release
// tarball depend on what is available on the host.
// To ensure it can be shared across all different
// GNU/Linux distributions, generate it in a minimal
// container. Wget uses GnuTLS, which looks up its
// certs from /etc/ssl/certs.
sh '''
#!/usr/bin/env bash
test -f $HOME/.bashrc && . $HOME/.bashrc
guix environment --container --network -E TARBALLS --share=$TARBALLS \
--expose=$SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt --ad-hoc \
coreutils \
gcc-toolchain \
git-minimal \
grep \
gzip \
make \
nss-certs \
pkg-config \
python \
sed \
tar \
wget \
xz -- make release-tarball
'''
}
}
stage('Build packages') {
environment {
DISABLE_CONTRIB_DOWNLOADS = 'TRUE'
// The following password is used to register with the
// RHEL subscription-manager tool, required to build on RHEL.
PASS = credentials('developers-redhat-com')
}
steps {
script {
def targetsText = sh script: 'make -s list-package-targets', returnStdout: true
def targets = targetsText.split('\n')
def stages = [:]
targets.each { target ->
// Note: The stage calls are wrapped in closures, to
// delay their execution.
stages["${target}"] = {
stage("stage: ${target}") {
sh "make ${target}"
}
}
}
parallel stages
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment