2018-08-14 14:09:52 -04:00
|
|
|
common = load 'ci/common.groovy'
|
2018-08-21 11:17:25 -04:00
|
|
|
ios = load 'ci/ios.groovy'
|
|
|
|
android = load 'ci/android.groovy'
|
|
|
|
|
2018-08-29 22:23:26 -04:00
|
|
|
def wait(lockFile) {
|
|
|
|
/* Crude wait for a lock file to disappear */
|
|
|
|
def maxAttempts = 20
|
|
|
|
def success = false
|
|
|
|
for (i = 0; i <= maxAttempts; i++) {
|
|
|
|
rval = fileExists(lockFile)
|
|
|
|
if (!rval) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
sleep 10
|
|
|
|
}
|
|
|
|
error("Failed to acquire lock: ${lockFile}")
|
2018-08-29 16:29:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
def podUpdate() {
|
|
|
|
/**
|
|
|
|
* This is awful BUT multiple jobs running on the same host can
|
|
|
|
* clash when trying to update the CocoaPods maste repo.
|
|
|
|
* We could set CP_REPOS_DIR, but the would result in
|
|
|
|
* multiple ~3GB directories all over the place and would be slow.
|
|
|
|
**/
|
2018-08-29 22:23:26 -04:00
|
|
|
def lockFile = "${env.HOME}/.cocoapods.lock"
|
|
|
|
try {
|
|
|
|
wait(lockFile)
|
|
|
|
sh "touch ${lockFile}"
|
|
|
|
sh 'pod update --silent'
|
|
|
|
} finally {
|
|
|
|
sh "rm ${lockFile}"
|
2018-08-29 16:29:09 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-23 08:56:19 -04:00
|
|
|
def prep(type = 'nightly') {
|
2018-08-30 14:56:45 +02:00
|
|
|
/* ensure that we start from a known state */
|
|
|
|
sh 'make clean'
|
2018-08-21 11:17:25 -04:00
|
|
|
/* select type of build */
|
|
|
|
switch (type) {
|
2018-08-22 15:20:47 -04:00
|
|
|
case 'nightly':
|
2018-08-21 11:17:25 -04:00
|
|
|
sh 'cp .env.nightly .env'; break
|
|
|
|
case 'release':
|
|
|
|
sh 'cp .env.prod .env'; break
|
|
|
|
case 'e2e':
|
|
|
|
sh 'cp .env.e2e .env'; break
|
2018-08-29 14:39:35 -04:00
|
|
|
default:
|
|
|
|
sh 'cp .env.jenkins .env'; break
|
2018-08-21 11:17:25 -04:00
|
|
|
}
|
2018-08-14 14:09:52 -04:00
|
|
|
common.installJSDeps('mobile')
|
2018-09-05 09:39:24 +03:00
|
|
|
sh 'cp patches/js_realm.hpp node_modules/realm/src/js_realm.hpp'
|
2018-08-31 22:36:51 -04:00
|
|
|
/* install ruby dependencies */
|
|
|
|
sh 'bundle install --quiet'
|
2018-08-21 11:17:25 -04:00
|
|
|
/* install Maven dependencies */
|
2018-08-14 14:09:52 -04:00
|
|
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
|
|
|
/* generate ios/StatusIm.xcworkspace */
|
|
|
|
dir('ios') {
|
2018-08-29 16:29:09 -04:00
|
|
|
podUpdate()
|
|
|
|
sh 'pod install --silent'
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-27 11:32:54 -04:00
|
|
|
def runLint() {
|
|
|
|
sh 'lein cljfmt check'
|
|
|
|
}
|
|
|
|
|
2018-08-14 14:09:52 -04:00
|
|
|
def runTests() {
|
|
|
|
sh 'lein test-cljs'
|
|
|
|
}
|
|
|
|
|
2018-08-29 14:38:12 +02:00
|
|
|
def leinBuild(platform) {
|
|
|
|
sh "lein prod-build-${platform}"
|
2018-08-14 14:09:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return this
|