2018-08-14 14:09:52 -04:00
|
|
|
pipeline {
|
|
|
|
agent { label 'macos' }
|
|
|
|
|
2018-12-11 12:00:22 +01:00
|
|
|
parameters {
|
2018-12-11 15:27:21 +01:00
|
|
|
string(
|
2018-12-11 12:00:22 +01:00
|
|
|
name: 'BUILD_TYPE',
|
|
|
|
description: 'Specify build type. Values: pr / nightly / release',
|
|
|
|
defaultValue: 'pr',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2018-08-14 14:09:52 -04:00
|
|
|
options {
|
2018-11-13 12:58:34 +01:00
|
|
|
timestamps()
|
2018-10-30 10:38:52 +01:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 25, unit: 'MINUTES')
|
|
|
|
/* Limit builds retained */
|
2018-08-14 14:09:52 -04:00
|
|
|
buildDiscarder(logRotator(
|
2018-12-13 10:49:16 +01:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
2018-08-14 14:09:52 -04:00
|
|
|
))
|
|
|
|
}
|
2018-09-25 20:01:48 +03:00
|
|
|
|
2018-08-14 14:09:52 -04:00
|
|
|
environment {
|
2019-05-10 17:33:54 +02:00
|
|
|
LANG = "en_US.UTF-8"
|
|
|
|
LC_ALL = "en_US.UTF-8"
|
|
|
|
LANGUAGE = "en_US.UTF-8"
|
2019-04-12 16:38:08 +02:00
|
|
|
TARGET_OS = 'macos'
|
2019-03-25 17:35:01 +01:00
|
|
|
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
2018-12-21 15:17:49 +01:00
|
|
|
VERBOSE_LEVEL = '3'
|
2019-05-10 17:33:54 +02:00
|
|
|
/* We use EXECUTOR_NUMBER to avoid multiple instances clashing */
|
|
|
|
LEIN_HOME = "/var/tmp/lein-${EXECUTOR_NUMBER}"
|
|
|
|
YARN_CACHE_FOLDER = "/var/tmp/yarn-${EXECUTOR_NUMBER}"
|
|
|
|
GRADLE_USER_HOME = "/var/tmp/gradle-${EXECUTOR_NUMBER}"
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
2018-09-25 20:01:48 +03:00
|
|
|
|
2018-08-14 14:09:52 -04:00
|
|
|
stages {
|
|
|
|
stage('Prep') {
|
|
|
|
steps {
|
2019-01-15 15:44:50 +01:00
|
|
|
script {
|
2018-08-14 14:09:52 -04:00
|
|
|
/* Necessary to load methods */
|
|
|
|
desktop = load 'ci/desktop.groovy'
|
2018-08-29 09:43:21 +02:00
|
|
|
cmn = load 'ci/common.groovy'
|
2019-02-05 10:35:14 +01:00
|
|
|
btype = cmn.utils.getBuildType()
|
|
|
|
print "Running ${btype} build!"
|
|
|
|
cmn.ci.abortPreviousRunningBuilds()
|
2019-01-15 15:44:50 +01:00
|
|
|
/* Cleanup and Prep */
|
2019-03-22 14:24:58 +01:00
|
|
|
cmn.prep(btype)
|
2019-01-15 15:44:50 +01:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
}
|
2018-09-25 20:01:48 +03:00
|
|
|
stage('Lint') {
|
2019-03-05 19:00:20 +01:00
|
|
|
steps {
|
2019-05-10 17:33:54 +02:00
|
|
|
script { cmn.nix.shell('lein cljfmt check') }
|
2019-03-05 19:00:20 +01:00
|
|
|
}
|
2018-09-25 20:01:48 +03:00
|
|
|
}
|
|
|
|
stage('Tests') {
|
2019-03-05 19:00:20 +01:00
|
|
|
steps {
|
2019-05-10 17:33:54 +02:00
|
|
|
script { cmn.nix.shell('lein test-cljs') }
|
2019-03-05 19:00:20 +01:00
|
|
|
}
|
2018-09-25 20:01:48 +03:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
stage('Build') {
|
2019-03-05 19:00:20 +01:00
|
|
|
steps {
|
2018-08-14 14:09:52 -04:00
|
|
|
script { desktop.buildClojureScript() }
|
2019-03-05 19:00:20 +01:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
stage('Compile') {
|
2018-12-06 20:51:41 +01:00
|
|
|
steps {
|
2018-09-13 11:44:33 +02:00
|
|
|
script { desktop.compile() }
|
2018-12-06 20:51:41 +01:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
stage('Bundle') {
|
2019-02-28 11:56:58 +01:00
|
|
|
steps {
|
2019-02-05 10:35:14 +01:00
|
|
|
script { dmg = desktop.bundleMacOS(btype) }
|
2019-02-28 11:56:58 +01:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
stage('Archive') {
|
2018-12-11 15:27:21 +01:00
|
|
|
steps {
|
|
|
|
archiveArtifacts dmg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
2019-02-05 10:35:14 +01:00
|
|
|
script { env.PKG_URL = cmn.utils.uploadArtifact(dmg) }
|
2018-12-11 15:27:21 +01:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
2018-12-13 10:49:16 +01:00
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
2019-02-05 10:35:14 +01:00
|
|
|
sh 'make clean'
|
2018-12-13 10:49:16 +01:00
|
|
|
}
|
|
|
|
}
|
2018-12-11 15:27:21 +01:00
|
|
|
}
|
|
|
|
post {
|
2019-06-07 10:49:36 -04:00
|
|
|
success { script { load('ci/github.groovy').notifyPR(true) } }
|
|
|
|
failure { script { load('ci/github.groovy').notifyPR(false) } }
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
}
|