fix build failure

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-08-29 22:23:26 -04:00
parent 76ace61d17
commit 95d0a782c3
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 23 additions and 19 deletions

View File

@ -29,7 +29,10 @@ def buildBranch(name = null, buildType) {
[name: 'BUILD_TYPE', value: buildType, $class: 'StringParameterValue'],
])
/* BlueOcean seems to not show child-build links */
print "URL: ${b.getAbsoluteUrl()}"
print "Build: ${b.getAbsoluteUrl()} (${b.result})"
if (b.result != 'SUCCESS') {
error("Build Failed")
}
return b
}

View File

@ -2,12 +2,18 @@ common = load 'ci/common.groovy'
ios = load 'ci/ios.groovy'
android = load 'ci/android.groovy'
def podLockExists() {
def lockFile = (
env.HOME+
'/.cocoapods/repos/master/.git/refs/remotes/origin/master.lock'
)
return fileExists(lockFile)
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}")
}
def podUpdate() {
@ -17,19 +23,14 @@ def podUpdate() {
* We could set CP_REPOS_DIR, but the would result in
* multiple ~3GB directories all over the place and would be slow.
**/
def maxAttempts = 10
def success = false
for (i = 0; i <= maxAttempts; i++) {
if (!podLockExists()) {
success = true
break
}
sleep 10
def lockFile = "${env.HOME}/.cocoapods.lock"
try {
wait(lockFile)
sh "touch ${lockFile}"
sh 'pod update --silent'
} finally {
sh "rm ${lockFile}"
}
if (!success) {
error('Another pod proc. is preventing us from updating!')
}
sh 'pod update --silent'
}
def prep(type = 'nightly') {