2023-04-20 18:36:10 +00:00
|
|
|
library 'status-jenkins-lib@v1.7.1'
|
2020-07-06 08:48:42 +00:00
|
|
|
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
2020-06-18 16:44:22 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
2023-04-18 12:22:27 +00:00
|
|
|
/* Necessary image with Ubuntu 18.04 for older Glibc. */
|
2021-09-29 14:49:30 +00:00
|
|
|
docker {
|
2020-06-18 16:44:22 +00:00
|
|
|
label 'linux'
|
2023-06-14 07:57:35 +00:00
|
|
|
image 'statusteam/nim-status-client-build:1.3.0-qt5.15.2'
|
2020-06-18 16:44:22 +00:00
|
|
|
/* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */
|
|
|
|
args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 14:45:46 +00:00
|
|
|
parameters {
|
2022-02-09 10:52:14 +00:00
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
|
|
|
description: 'Decides whether binaries are built with debug symbols.',
|
|
|
|
defaultValue: params.RELEASE ?: false
|
2021-04-19 14:45:46 +00:00
|
|
|
)
|
2022-02-09 10:59:41 +00:00
|
|
|
choice(
|
|
|
|
name: 'VERBOSE',
|
|
|
|
description: 'Level of verbosity based on nimbus-build-system setup.',
|
|
|
|
choices: ['0', '1', '2']
|
|
|
|
)
|
2023-06-06 09:13:32 +00:00
|
|
|
string(
|
|
|
|
name: 'NIMFLAGS',
|
|
|
|
description: 'Extra Nim flags. Examples: --verbosity:2 --passL:"-v" --passC:"-v"',
|
|
|
|
defaultValue: '--colors:off'
|
|
|
|
)
|
2021-04-19 14:45:46 +00:00
|
|
|
}
|
|
|
|
|
2020-06-18 16:44:22 +00:00
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2021-11-22 10:40:22 +00:00
|
|
|
timeout(time: 20, unit: 'MINUTES')
|
2020-06-18 16:44:22 +00:00
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2020-11-24 18:42:31 +00:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
2021-03-25 20:49:27 +00:00
|
|
|
artifactNumToKeepStr: '3',
|
2020-06-18 16:44:22 +00:00
|
|
|
))
|
2023-04-18 12:22:27 +00:00
|
|
|
/* Allows combined build to copy */
|
|
|
|
copyArtifactPermission('/status-desktop/*')
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2023-04-07 14:17:30 +00:00
|
|
|
TARGET = "linux/${getArch()}"
|
2020-06-18 16:44:22 +00:00
|
|
|
/* Improve make performance */
|
2022-02-09 10:59:41 +00:00
|
|
|
MAKEFLAGS = "-j4 V=${params.VERBOSE}"
|
2020-07-02 08:07:19 +00:00
|
|
|
/* Makefile assumes the compiler folder is included */
|
2023-01-19 13:22:26 +00:00
|
|
|
QTDIR = "/opt/qt/5.15.2/gcc_64"
|
2023-04-07 16:19:46 +00:00
|
|
|
PATH = "${env.QTDIR}/bin:${env.PATH}"
|
2023-06-12 09:21:21 +00:00
|
|
|
/* Avoid weird bugs caused by stale cache. */
|
|
|
|
QML_DISABLE_DISK_CACHE = "true"
|
2020-06-18 16:44:22 +00:00
|
|
|
/* Control output the filename */
|
2023-04-06 09:44:38 +00:00
|
|
|
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage', arch: getArch())}"
|
|
|
|
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz', arch: getArch())}"
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2020-09-28 19:24:21 +00:00
|
|
|
stage('Deps') {
|
2020-06-18 16:44:22 +00:00
|
|
|
steps {
|
2022-11-14 16:02:46 +00:00
|
|
|
sh 'make update'
|
2022-04-15 09:17:19 +00:00
|
|
|
sh 'make deps'
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('status-go') {
|
2022-07-18 18:17:48 +00:00
|
|
|
steps {
|
|
|
|
sh 'make status-go'
|
|
|
|
}
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 01:53:34 +00:00
|
|
|
stage('Package') {
|
2021-08-04 15:41:31 +00:00
|
|
|
steps { script {
|
|
|
|
linux.bundle('tgz-linux')
|
|
|
|
} }
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
|
2020-07-06 08:48:42 +00:00
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
2021-06-04 19:44:39 +00:00
|
|
|
env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_TARBALL)
|
2020-09-28 05:55:58 +00:00
|
|
|
jenkins.setBuildDesc(AppImage: env.PKG_URL)
|
2020-07-06 08:48:42 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
2021-08-04 15:41:31 +00:00
|
|
|
archiveArtifacts("${env.STATUS_CLIENT_TARBALL}*")
|
2020-07-06 08:48:42 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
2020-07-06 08:48:42 +00:00
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2022-11-22 12:40:45 +00:00
|
|
|
cleanup { sh './scripts/clean-git.sh' }
|
2020-06-18 16:44:22 +00:00
|
|
|
}
|
|
|
|
}
|
2023-04-06 09:44:38 +00:00
|
|
|
|
|
|
|
def getArch() {
|
|
|
|
def tokens = Thread.currentThread().getName().split('/')
|
|
|
|
for (def arch in ['x86_64', 'aarch64']) {
|
|
|
|
if (tokens.contains(arch)) { return arch }
|
|
|
|
}
|
|
|
|
}
|