2018-11-06 21:29:16 +00:00
|
|
|
pipeline {
|
2019-04-11 18:03:36 +00:00
|
|
|
agent { label 'linux' }
|
2018-11-06 21:29:16 +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-11-06 21:29:16 +00:00
|
|
|
options {
|
2018-12-11 14:27:21 +00:00
|
|
|
timestamps()
|
2018-11-06 21:29:16 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 45, unit: 'MINUTES')
|
|
|
|
/* Limit builds retained */
|
|
|
|
buildDiscarder(logRotator(
|
2018-12-13 09:49:16 +00:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
2018-11-06 21:29:16 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WARNING: Jenkins ignores PATH changes in Docker
|
|
|
|
* https://issues.jenkins-ci.org/browse/JENKINS-49076
|
|
|
|
**/
|
|
|
|
environment {
|
2019-05-10 15:33:54 +00:00
|
|
|
LANG = "en_US.UTF-8"
|
|
|
|
LC_ALL = "en_US.UTF-8"
|
|
|
|
LANGUAGE = "en_US.UTF-8"
|
2019-04-12 14:38:08 +00:00
|
|
|
TARGET_OS = 'windows'
|
2019-03-25 16:35:01 +00:00
|
|
|
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
2019-05-10 15:33:54 +00:00
|
|
|
VERBOSE_LEVEL = '3'
|
|
|
|
/* Conan settings */
|
2018-11-06 21:29:16 +00:00
|
|
|
CONAN_PRINT_RUN_COMMANDS = '1'
|
|
|
|
CONAN_SYSREQUIRES_MODE = 'disabled'
|
|
|
|
CONAN_SYSREQUIRES_SUDO = '0'
|
2019-05-10 15:33:54 +00: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}"
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Prep') {
|
2018-12-05 10:41:06 +00:00
|
|
|
steps {
|
2019-01-15 14:44:50 +00:00
|
|
|
script {
|
2018-11-06 21:29:16 +00:00
|
|
|
/* Necessary to load methods */
|
|
|
|
desktop = load 'ci/desktop.groovy'
|
|
|
|
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
|
|
|
/* Cleanup and Prep */
|
2019-03-22 13:24:58 +00:00
|
|
|
cmn.prep(btype)
|
2019-01-15 14:44:50 +00:00
|
|
|
}
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
|
|
|
}
|
2019-06-07 16:48:54 +00:00
|
|
|
stage('Parallel') {
|
|
|
|
parallel {
|
|
|
|
stage('Checks') { stages {
|
|
|
|
stage('Lint') {
|
|
|
|
steps {
|
2019-06-04 16:50:29 +00:00
|
|
|
script { cmn.nix.shell('lein cljfmt check', attr: 'targets.leiningen.shell') }
|
2019-06-07 16:48:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Tests') {
|
|
|
|
steps {
|
2019-06-04 16:50:29 +00:00
|
|
|
script { cmn.nix.shell('lein test-cljs', attr: 'targets.leiningen.shell') }
|
2019-06-07 16:48:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
stage('Build') { stages {
|
|
|
|
stage('Clojure') {
|
|
|
|
steps {
|
|
|
|
script { desktop.buildClojureScript() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Compile') {
|
|
|
|
steps {
|
|
|
|
script { desktop.compile() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Bundle') {
|
|
|
|
steps {
|
|
|
|
script { app = desktop.bundleWindows(btype) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} }
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
2018-12-11 14:27:21 +00:00
|
|
|
steps {
|
|
|
|
archiveArtifacts app
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
2019-02-05 09:35:14 +00:00
|
|
|
script { env.PKG_URL = cmn.utils.uploadArtifact(app) }
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
2018-12-13 09:49:16 +00:00
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
2019-06-11 09:43:44 +00:00
|
|
|
sh 'make watchman-clean'
|
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-06-07 14:49:36 +00:00
|
|
|
success { script { load('ci/github.groovy').notifyPR(true) } }
|
|
|
|
failure { script { load('ci/github.groovy').notifyPR(false) } }
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
|
|
|
}
|