Migrate remaining CI builds to Nix

This commit is contained in:
Pedro Pombeiro 2019-03-05 19:00:20 +01:00
parent 015f02ae84
commit 5440378bbc
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
5 changed files with 32 additions and 34 deletions

View File

@ -23,9 +23,11 @@ pipeline {
environment { environment {
TARGET_PLATFORM = 'ios' TARGET_PLATFORM = 'ios'
CI_ENVIRONMENT = 'jenkins'
LANG = 'en_US.UTF-8' LANG = 'en_US.UTF-8'
LANGUAGE = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8'
LC_ALL = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8'
NIX_CONF_DIR = "${env.WORKSPACE}/scripts/lib/setup/nix"
FASTLANE_DISABLE_COLORS=1 FASTLANE_DISABLE_COLORS=1
REALM_DISABLE_ANALYTICS=1 REALM_DISABLE_ANALYTICS=1
BUNDLE_PATH = "${HOME}/.bundle" BUNDLE_PATH = "${HOME}/.bundle"
@ -41,34 +43,31 @@ pipeline {
btype = cmn.utils.getBuildType() btype = cmn.utils.getBuildType()
print "Running ${btype} build!" print "Running ${btype} build!"
cmn.ci.abortPreviousRunningBuilds() cmn.ci.abortPreviousRunningBuilds()
/* Read the valid NodeJS version */
env.NODE_VERSION = cmn.utils.getToolVersion('node')
/* Cleanup and Prep */ /* Cleanup and Prep */
nvm(env.NODE_VERSION) { cmn.prepNixEnvironment()
mobile.prep(btype) mobile.prep(btype)
} }
} }
} }
}
stage('Lint') { stage('Lint') {
steps {nvm(env.NODE_VERSION) { steps {
script { cmn.utils.nix_sh('lein cljfmt check') } script { cmn.utils.nix_sh('lein cljfmt check') }
} } }
} }
stage('Tests') { stage('Tests') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.utils.nix_sh('lein test-cljs') } script { cmn.utils.nix_sh('lein test-cljs') }
} } }
} }
stage('Build') { stage('Build') {
steps { nvm(env.NODE_VERSION) { steps {
sh "lein prod-build-ios" script { cmn.utils.nix_sh('lein prod-build-ios') }
} } }
} }
stage('Bundle') { stage('Bundle') {
steps { nvm(env.NODE_VERSION) { steps {
script { api = mobile.ios.bundle(btype) } script { api = mobile.ios.bundle(btype) }
} } }
} }
stage('Archive') { stage('Archive') {
steps { steps {

View File

@ -23,12 +23,11 @@ pipeline {
environment { environment {
TARGET_PLATFORM = 'macos' TARGET_PLATFORM = 'macos'
CI_ENVIRONMENT = 'jenkins'
LANG = 'en_US.UTF-8' LANG = 'en_US.UTF-8'
LANGUAGE = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8'
LC_ALL = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8'
QT_PATH = '/usr/local/opt/qt' NIX_CONF_DIR = "${env.WORKSPACE}/scripts/lib/setup/nix"
PATH = "/usr/local/opt/qt/bin:${env.PATH}"
MACDEPLOYQT = '/usr/local/opt/qt/bin/macdeployqt'
VERBOSE_LEVEL = '3' VERBOSE_LEVEL = '3'
} }
@ -42,30 +41,26 @@ pipeline {
btype = cmn.utils.getBuildType() btype = cmn.utils.getBuildType()
print "Running ${btype} build!" print "Running ${btype} build!"
cmn.ci.abortPreviousRunningBuilds() cmn.ci.abortPreviousRunningBuilds()
/* Read the valid NodeJS version */
env.NODE_VERSION = cmn.utils.getToolVersion('node')
/* Cleanup and Prep */ /* Cleanup and Prep */
cmn.prepNixEnvironment() cmn.prepNixEnvironment()
nvm(env.NODE_VERSION) {
desktop.prepDeps() desktop.prepDeps()
} }
} }
} }
}
stage('Lint') { stage('Lint') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.utils.nix_sh('lein cljfmt check') } script { cmn.utils.nix_sh('lein cljfmt check') }
} } }
} }
stage('Tests') { stage('Tests') {
steps { nvm(env.NODE_VERSION) { steps {
script { cmn.utils.nix_sh('lein test-cljs') } script { cmn.utils.nix_sh('lein test-cljs') }
} } }
} }
stage('Build') { stage('Build') {
steps { nvm(env.NODE_VERSION) { steps {
script { desktop.buildClojureScript() } script { desktop.buildClojureScript() }
} } }
} }
stage('Compile') { stage('Compile') {
steps { steps {

View File

@ -36,11 +36,13 @@ pipeline {
**/ **/
environment { environment {
TARGET_PLATFORM = 'windows' TARGET_PLATFORM = 'windows'
CI_ENVIRONMENT = 'jenkins'
LANG = 'en_US.UTF-8' LANG = 'en_US.UTF-8'
LANGUAGE = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8'
LC_ALL = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8'
NPM_CONFIG_CACHE = '/var/tmp/npm' NPM_CONFIG_CACHE = '/var/tmp/npm'
LEIN_HOME = '/var/tmp/lein' LEIN_HOME = '/var/tmp/lein'
NIX_CONF_DIR = "${env.WORKSPACE}/scripts/lib/setup/nix"
TARGET_SYSTEM_NAME = 'Windows' TARGET_SYSTEM_NAME = 'Windows'
CONAN_PRINT_RUN_COMMANDS = '1' CONAN_PRINT_RUN_COMMANDS = '1'
CONAN_SYSREQUIRES_MODE = 'disabled' CONAN_SYSREQUIRES_MODE = 'disabled'
@ -59,6 +61,7 @@ pipeline {
print "Running ${btype} build!" print "Running ${btype} build!"
cmn.ci.abortPreviousRunningBuilds() cmn.ci.abortPreviousRunningBuilds()
/* Cleanup and Prep */ /* Cleanup and Prep */
cmn.prepNixEnvironment()
desktop.prepDeps() desktop.prepDeps()
} }
} }

View File

@ -6,11 +6,11 @@ with stdenv;
let let
targetLinux = { targetLinux = {
"linux" = true; "linux" = true;
"" = true; "" = isLinux;
}.${target-os} or false; }.${target-os} or false;
targetWindows = { targetWindows = {
"windows" = true; "windows" = true;
"" = true; "" = isLinux;
}.${target-os} or false; }.${target-os} or false;
windowsPlatform = callPackage ./windows { }; windowsPlatform = callPackage ./windows { };
appimagekit = callPackage ./appimagekit { }; appimagekit = callPackage ./appimagekit { };

View File

@ -12,7 +12,8 @@ let
in in
{ {
buildInputs = lib.optional targetAndroid [ buildInputs = [ bundler ] ++
lib.optional targetAndroid [
android-ndk android-ndk
openjdk openjdk
]; ];