2021-07-06 18:04:05 +00:00
|
|
|
pipeline {
|
2023-04-13 14:12:22 +00:00
|
|
|
agent {
|
|
|
|
docker {
|
2023-05-03 02:30:18 +00:00
|
|
|
image 'registry.git.facekapow.dev/darling-build-image-top:latest'
|
2023-04-13 14:12:22 +00:00
|
|
|
registryUrl 'https://registry.git.facekapow.dev'
|
|
|
|
alwaysPull true
|
2023-05-03 02:30:18 +00:00
|
|
|
args '-u ci:ci -v /var/run/docker.sock:/var/run/docker.sock --group-add docker'
|
2023-04-13 14:12:22 +00:00
|
|
|
label 'darling'
|
|
|
|
}
|
|
|
|
}
|
2021-07-06 18:04:05 +00:00
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
parameters {
|
|
|
|
booleanParam(name: 'DEB', defaultValue: true, description: 'If true, build Debian packages.')
|
2023-05-04 01:57:29 +00:00
|
|
|
booleanParam(name: 'RPM', defaultValue: true, description: 'If true, build RPM packages.')
|
2023-05-03 02:30:18 +00:00
|
|
|
}
|
|
|
|
|
2021-07-06 18:04:05 +00:00
|
|
|
triggers {
|
|
|
|
githubPush()
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
ESCAPED_JOB_NAME = sh(script: 'echo "${JOB_NAME}" | sed \'s/\\//-/g\'', returnStdout: true).trim()
|
2023-05-03 02:30:18 +00:00
|
|
|
CCACHE_DIR = credentials('darling-ccache-dir')
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
skipDefaultCheckout()
|
2023-04-13 14:12:22 +00:00
|
|
|
disableConcurrentBuilds abortPrevious: true
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Start Job') {
|
|
|
|
steps {
|
2023-04-13 14:12:22 +00:00
|
|
|
scmSkip(deleteBuild: true, skipPattern:'.*\\[ci skip\\].*')
|
2021-07-06 18:04:05 +00:00
|
|
|
|
2023-04-13 14:12:22 +00:00
|
|
|
dir('source') {
|
|
|
|
checkout scm
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
stage('Prepare') {
|
2021-07-06 18:04:05 +00:00
|
|
|
steps {
|
2023-04-13 14:12:22 +00:00
|
|
|
dir('source') {
|
|
|
|
sh 'git submodule update --init --recursive'
|
|
|
|
sh 'cd src/external/swift && git lfs install && git lfs pull'
|
|
|
|
touch '../.submodules-cloned'
|
2023-05-03 02:30:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-07-06 18:04:05 +00:00
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
stage('Build Debian') {
|
|
|
|
when { expression { params.DEB } }
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'registry.git.facekapow.dev/darling-build-image:latest'
|
|
|
|
registryUrl 'https://registry.git.facekapow.dev'
|
|
|
|
alwaysPull true
|
|
|
|
args '-u ci:ci -v ${WORKSPACE}/source:/src/mnt:rw -v ${CCACHE_DIR}:/ccache:rw'
|
|
|
|
label 'darling'
|
|
|
|
reuseNode true
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
2023-05-03 02:30:18 +00:00
|
|
|
}
|
|
|
|
environment {
|
|
|
|
DEB_DISTRO = sh(script: 'lsb_release -cs', returnStdout: true).trim()
|
|
|
|
CCACHE_DIR = '/ccache'
|
|
|
|
CCACHE_BASEDIR = '/src/mnt'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
//sh 'tools/debian/make-deb --dsc'
|
|
|
|
sh '''#!/bin/bash
|
|
|
|
pushd /src/mnt
|
|
|
|
tools/debian/make-deb
|
|
|
|
popd
|
|
|
|
'''
|
|
|
|
|
|
|
|
sh 'rm -rf out-deb'
|
|
|
|
sh 'mkdir out-deb'
|
|
|
|
|
|
|
|
dir('out-deb') {
|
|
|
|
sh 'mv /src/*.deb ./'
|
|
|
|
}
|
|
|
|
|
|
|
|
archiveArtifacts artifacts: 'out-deb/**/*', fingerprint: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build RPM') {
|
|
|
|
when { expression { params.RPM } }
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'registry.git.facekapow.dev/darling-build-image-fedora:latest'
|
|
|
|
registryUrl 'https://registry.git.facekapow.dev'
|
|
|
|
alwaysPull true
|
|
|
|
args '-v ${WORKSPACE}/source:/src:ro -v ${CCACHE_DIR}:/ccache:rw'
|
|
|
|
label 'darling'
|
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
CCACHE_DIR = '/ccache'
|
|
|
|
CCACHE_BASEDIR = '/home/ci/rpmbuild/BUILD/darling'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'bash -xv /src/rpm/build.bsh'
|
2021-07-06 18:04:05 +00:00
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
sh 'rm -rf out-rpm'
|
|
|
|
sh 'mkdir out-rpm'
|
2021-07-06 18:04:05 +00:00
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
dir('out-rpm') {
|
|
|
|
sh 'mv ${HOME}/rpmbuild/RPMS/x86_64/*.rpm ./'
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
2023-04-13 14:12:22 +00:00
|
|
|
|
2023-05-03 02:30:18 +00:00
|
|
|
archiveArtifacts artifacts: 'out-rpm/**/*', fingerprint: true
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup {
|
2023-04-13 14:12:22 +00:00
|
|
|
script {
|
|
|
|
if (!fileExists('.submodules-cloned')) {
|
|
|
|
sh 'rm -rf source'
|
2021-07-06 18:04:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|