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

View File

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

View File

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

View File

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

View File

@ -12,10 +12,11 @@ let
in
{
buildInputs = lib.optional targetAndroid [
android-ndk
openjdk
];
buildInputs = [ bundler ] ++
lib.optional targetAndroid [
android-ndk
openjdk
];
shellHook = lib.optionalString targetAndroid ''
export JAVA_HOME="${openjdk}"
export ANDROID_HOME=~/.status/Android/Sdk