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'], [name: 'BUILD_TYPE', value: buildType, $class: 'StringParameterValue'],
]) ])
/* BlueOcean seems to not show child-build links */ /* 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 return b
} }

View File

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