2022-07-18 20:17:48 +02:00
|
|
|
library 'status-jenkins-lib@v1.5.6'
|
2020-07-06 10:48:42 +02:00
|
|
|
|
2022-09-21 12:06:45 +02:00
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
2020-06-18 18:44:22 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
2021-09-29 17:49:30 +03:00
|
|
|
docker {
|
2020-06-18 18:44:22 +02:00
|
|
|
label 'linux'
|
2022-08-02 16:33:25 -04:00
|
|
|
image 'statusteam/nim-status-client-build:1.1.5'
|
2020-06-18 18:44:22 +02: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 16:45:46 +02:00
|
|
|
parameters {
|
2022-02-09 11:52:14 +01:00
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
|
|
|
description: 'Decides whether binaries are built with debug symbols.',
|
|
|
|
defaultValue: params.RELEASE ?: false
|
2021-04-19 16:45:46 +02:00
|
|
|
)
|
2022-02-09 11:59:41 +01:00
|
|
|
choice(
|
|
|
|
name: 'VERBOSE',
|
|
|
|
description: 'Level of verbosity based on nimbus-build-system setup.',
|
|
|
|
choices: ['0', '1', '2']
|
|
|
|
)
|
2021-04-19 16:45:46 +02:00
|
|
|
}
|
|
|
|
|
2020-06-18 18:44:22 +02:00
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2021-11-22 11:40:22 +01:00
|
|
|
timeout(time: 20, unit: 'MINUTES')
|
2020-06-18 18:44:22 +02:00
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2020-11-24 19:42:31 +01:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
2021-03-25 21:49:27 +01:00
|
|
|
artifactNumToKeepStr: '3',
|
2020-06-18 18:44:22 +02:00
|
|
|
))
|
2022-09-21 12:06:45 +02:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2020-07-06 10:48:42 +02:00
|
|
|
TARGET = 'linux'
|
2020-06-18 18:44:22 +02:00
|
|
|
/* Improve make performance */
|
2022-02-09 11:59:41 +01:00
|
|
|
MAKEFLAGS = "-j4 V=${params.VERBOSE}"
|
2020-06-18 18:44:22 +02:00
|
|
|
/* Disable colors in Nim compiler logs */
|
|
|
|
NIMFLAGS = '--colors:off'
|
2020-07-02 10:07:19 +02:00
|
|
|
/* Makefile assumes the compiler folder is included */
|
|
|
|
QTDIR = "/opt/qt/5.14.0/gcc_64"
|
2020-06-18 18:44:22 +02:00
|
|
|
/* Control output the filename */
|
2021-09-28 13:57:19 +02:00
|
|
|
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage')}"
|
|
|
|
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz')}"
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2020-09-28 21:24:21 +02:00
|
|
|
stage('Deps') {
|
2020-06-18 18:44:22 +02:00
|
|
|
steps {
|
2021-04-14 14:44:13 +02:00
|
|
|
/* trigger fetching of git submodules */
|
|
|
|
sh 'make check-pkg-target-linux'
|
2022-04-15 11:17:19 +02:00
|
|
|
/* TODO: Re-add caching of Nim compiler. */
|
|
|
|
sh 'make deps'
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('status-go') {
|
2022-07-18 20:17:48 +02:00
|
|
|
steps {
|
|
|
|
sh 'make status-go'
|
|
|
|
}
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
|
2020-10-29 20:53:34 -05:00
|
|
|
stage('Package') {
|
2021-08-04 17:41:31 +02:00
|
|
|
steps { script {
|
|
|
|
linux.bundle('tgz-linux')
|
|
|
|
} }
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
|
2020-07-06 10:48:42 +02:00
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
2021-06-04 14:44:39 -05:00
|
|
|
env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_TARBALL)
|
2020-09-28 07:55:58 +02:00
|
|
|
jenkins.setBuildDesc(AppImage: env.PKG_URL)
|
2020-07-06 10:48:42 +02:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
2021-08-04 17:41:31 +02:00
|
|
|
archiveArtifacts("${env.STATUS_CLIENT_TARBALL}*")
|
2020-07-06 10:48:42 +02:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
2020-06-18 18:44:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
2020-07-06 10:48:42 +02:00
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2020-06-18 18:44:22 +02:00
|
|
|
always { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|