Retry hash retrieval from i.diawi.com if it returns null. Fixes #3455
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
268b07fddc
commit
292d1e13ba
|
@ -60,8 +60,11 @@ timeout(90) {
|
|||
stage('Deploy (Android)') {
|
||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')] ) {
|
||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||
sh 'sleep 10'
|
||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||
def hash = 'null'
|
||||
for (int r = 0; r < 6 && hash == 'null'; r++) {
|
||||
sh 'sleep 10'
|
||||
hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||
}
|
||||
apkUrl = 'https://i.diawi.com/' + hash
|
||||
|
||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||
|
@ -77,8 +80,11 @@ timeout(90) {
|
|||
stage('Deploy (iOS)') {
|
||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||
sh 'sleep 10'
|
||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||
def hash = 'null'
|
||||
for (int r = 0; r < 6 && hash == 'null'; r++) {
|
||||
sh 'sleep 10'
|
||||
hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||
}
|
||||
ipaUrl = 'https://i.diawi.com/' + hash
|
||||
|
||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||
|
|
Loading…
Reference in New Issue