2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
2018-09-25 17:01:48 +00:00
|
|
|
agent {
|
2018-09-05 18:17:25 +00:00
|
|
|
/* privileged mode is necessary for fuse */
|
|
|
|
docker {
|
2019-02-26 20:58:15 +00:00
|
|
|
label 'linux'
|
2019-01-23 10:11:31 +00:00
|
|
|
/* WARNING: remember to keep this up-to-date with the value in docker/linux/Makefile */
|
2019-02-26 20:58:15 +00:00
|
|
|
image 'statusteam/status-build-linux:1.1.1-8e5f6658'
|
2018-09-05 18:17:25 +00:00
|
|
|
args (
|
|
|
|
"-v /var/tmp/lein:/var/tmp/lein:rw "+
|
|
|
|
"-v /var/tmp/npm:/var/tmp/npm:rw "+
|
2018-12-09 13:59:42 +00:00
|
|
|
"-v /opt/desktop-files:/opt/desktop-files:rw"
|
2018-09-05 18:17:25 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
|
2018-12-11 11:00:22 +00:00
|
|
|
parameters {
|
2018-12-11 14:27:21 +00:00
|
|
|
string(
|
2018-12-11 11:00:22 +00:00
|
|
|
name: 'BUILD_TYPE',
|
|
|
|
description: 'Specify build type. Values: pr / nightly / release',
|
|
|
|
defaultValue: 'pr',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
options {
|
2018-11-13 11:58:34 +00:00
|
|
|
timestamps()
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2019-01-22 11:34:34 +00:00
|
|
|
timeout(time: 40, unit: 'MINUTES')
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Limit builds retained */
|
2018-08-14 18:09:52 +00:00
|
|
|
buildDiscarder(logRotator(
|
2018-12-13 09:49:16 +00:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
2018-08-14 18:09:52 +00:00
|
|
|
))
|
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
|
2018-09-05 18:17:25 +00:00
|
|
|
/**
|
|
|
|
* WARNING: Jenkins ignores PATH changes in Docker
|
|
|
|
* https://issues.jenkins-ci.org/browse/JENKINS-49076
|
|
|
|
**/
|
2018-08-14 18:09:52 +00:00
|
|
|
environment {
|
2018-09-18 12:22:30 +00:00
|
|
|
BUILD_PLATFORM = 'linux'
|
2018-08-14 18:09:52 +00:00
|
|
|
LANG = 'en_US.UTF-8'
|
|
|
|
LANGUAGE = 'en_US.UTF-8'
|
|
|
|
LC_ALL = 'en_US.UTF-8'
|
2018-09-05 18:17:25 +00:00
|
|
|
NPM_CONFIG_CACHE = '/var/tmp/npm'
|
|
|
|
LEIN_HOME = '/var/tmp/lein'
|
2018-09-28 16:29:13 +00:00
|
|
|
QT_PATH = '/opt/qt'
|
2018-12-09 13:59:42 +00:00
|
|
|
STATUSIM_APPIMAGE_DIR = '/opt/desktop-files'
|
2018-12-21 14:17:49 +00:00
|
|
|
VERBOSE_LEVEL = '3'
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
stages {
|
|
|
|
stage('Prep') {
|
|
|
|
steps {
|
2019-01-15 14:44:50 +00:00
|
|
|
script {
|
2018-08-14 18:09:52 +00:00
|
|
|
/* Necessary to load methods */
|
|
|
|
desktop = load 'ci/desktop.groovy'
|
2018-08-29 07:43:21 +00:00
|
|
|
cmn = load 'ci/common.groovy'
|
2019-01-21 18:19:32 +00:00
|
|
|
print "Running ${cmn.getBuildType()} build!"
|
|
|
|
cmn.abortPreviousRunningBuilds()
|
2019-01-15 14:44:50 +00:00
|
|
|
/* Cleanup and Prep */
|
2019-01-18 00:31:07 +00:00
|
|
|
desktop.prepDeps()
|
2019-01-15 14:44:50 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
stage('Lint') {
|
2019-01-18 00:31:07 +00:00
|
|
|
steps {
|
2018-09-25 17:01:48 +00:00
|
|
|
script { cmn.runLint() }
|
2019-01-18 00:31:07 +00:00
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
}
|
|
|
|
stage('Tests') {
|
2019-01-18 00:31:07 +00:00
|
|
|
steps {
|
2018-09-25 17:01:48 +00:00
|
|
|
script { cmn.runTests() }
|
2019-01-18 00:31:07 +00:00
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
stage('Build') {
|
2019-01-18 00:31:07 +00:00
|
|
|
steps {
|
2018-08-14 18:09:52 +00:00
|
|
|
script { desktop.buildClojureScript() }
|
2019-01-18 00:31:07 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Compile') {
|
2019-01-18 00:31:07 +00:00
|
|
|
steps {
|
2018-09-13 09:44:33 +00:00
|
|
|
script { desktop.compile() }
|
2019-01-18 00:31:07 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Bundle') {
|
|
|
|
steps {
|
2018-08-29 07:43:21 +00:00
|
|
|
script { app = desktop.bundleLinux(cmn.getBuildType()) }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
2018-12-11 14:27:21 +00:00
|
|
|
steps {
|
|
|
|
archiveArtifacts app
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
|
|
|
script { env.PKG_URL = cmn.uploadArtifact(app) }
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-12-13 09:49:16 +00:00
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
|
|
|
script { cmn.clean() }
|
|
|
|
}
|
|
|
|
}
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
|
|
|
post {
|
2018-12-13 13:22:36 +00:00
|
|
|
failure { script { load('ci/common.groovy').notifyPRFailure() } }
|
2019-01-09 10:53:59 +00:00
|
|
|
success { script { load('ci/common.groovy').notifyPRSuccess() } }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|