2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'macos' }
|
|
|
|
|
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 */
|
|
|
|
timeout(time: 25, unit: 'MINUTES')
|
|
|
|
/* 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-08-14 18:09:52 +00:00
|
|
|
environment {
|
2018-09-18 12:22:30 +00:00
|
|
|
BUILD_PLATFORM = 'macos'
|
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-28 16:29:13 +00:00
|
|
|
QT_PATH = '/usr/local/opt/qt'
|
|
|
|
PATH = "/usr/local/opt/qt/bin:${env.PATH}"
|
2018-12-06 14:52:16 +00:00
|
|
|
MACDEPLOYQT = '/usr/local/opt/qt/bin/macdeployqt'
|
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-02-05 09:35:14 +00:00
|
|
|
btype = cmn.utils.getBuildType()
|
|
|
|
print "Running ${btype} build!"
|
|
|
|
cmn.ci.abortPreviousRunningBuilds()
|
2019-01-15 14:44:50 +00:00
|
|
|
/* Read the valid NodeJS version */
|
2019-02-05 09:35:14 +00:00
|
|
|
env.NODE_VERSION = cmn.utils.getToolVersion('node')
|
2019-01-15 14:44:50 +00:00
|
|
|
/* Cleanup and Prep */
|
|
|
|
nvm(env.NODE_VERSION) {
|
|
|
|
desktop.prepDeps()
|
|
|
|
}
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
stage('Lint') {
|
2018-12-05 10:10:07 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2019-02-05 09:35:14 +00:00
|
|
|
sh 'lein cljfmt check'
|
2018-12-05 10:10:07 +00:00
|
|
|
} }
|
2018-09-25 17:01:48 +00:00
|
|
|
}
|
|
|
|
stage('Tests') {
|
2018-12-05 10:10:07 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2019-02-05 09:35:14 +00:00
|
|
|
sh 'lein test-cljs'
|
2018-12-05 10:10:07 +00:00
|
|
|
} }
|
2018-09-25 17:01:48 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
stage('Build') {
|
2018-12-05 10:10:07 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2018-08-14 18:09:52 +00:00
|
|
|
script { desktop.buildClojureScript() }
|
2018-12-05 10:10:07 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Compile') {
|
2018-12-06 19:51:41 +00:00
|
|
|
steps {
|
2018-09-13 09:44:33 +00:00
|
|
|
script { desktop.compile() }
|
2018-12-06 19:51:41 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Bundle') {
|
2018-12-06 19:51:41 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2019-02-05 09:35:14 +00:00
|
|
|
script { dmg = desktop.bundleMacOS(btype) }
|
2018-12-06 19:51:41 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Archive') {
|
2018-12-11 14:27:21 +00:00
|
|
|
steps {
|
|
|
|
archiveArtifacts dmg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
2019-02-05 09:35:14 +00:00
|
|
|
script { env.PKG_URL = cmn.utils.uploadArtifact(dmg) }
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-12-13 09:49:16 +00:00
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
2019-02-05 09:35:14 +00:00
|
|
|
sh 'make clean'
|
2018-12-13 09:49:16 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
|
|
|
post {
|
2019-02-05 09:35:14 +00:00
|
|
|
success { script { load('ci/common.groovy').notifyPR(true) } }
|
|
|
|
failure { script { load('ci/common.groovy').notifyPR(false) } }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|