add diawi upload retries
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
c4f719352e
commit
3774a0845a
|
@ -36,8 +36,8 @@ def notifyPR(success) {
|
|||
} catch (ex) { /* fallback to posting directly to GitHub */
|
||||
println "Failed to use GHCMGR: ${ex}"
|
||||
switch (success) {
|
||||
case true: gh.NotifyPRSuccess(); break
|
||||
case false: gh.NotifyPRFailure(); break
|
||||
case true: gh.notifyPRSuccess(); break
|
||||
case false: gh.notifyPRFailure(); break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,17 +34,28 @@ def postBuild(success) {
|
|||
def ghcmgrurl = 'https://ghcmgr.status.im'
|
||||
def body = buildObj(success)
|
||||
def json = new JsonBuilder(body).toPrettyString()
|
||||
def stdout = null
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'ghcmgr-auth',
|
||||
usernameVariable: 'GHCMGR_USER',
|
||||
passwordVariable: 'GHCMGR_PASS'
|
||||
)]) {
|
||||
sh """
|
||||
curl --silent --verbose -XPOST --data '${json}' \
|
||||
stdout = sh(
|
||||
returnStdout: true,
|
||||
script: """
|
||||
curl --silent \
|
||||
-XPOST --data '${json}' \
|
||||
-u '${GHCMGR_USER}:${GHCMGR_PASS}' \
|
||||
-w '\nHTTP_CODE:%{http_code}' \
|
||||
-H "content-type: application/json" \
|
||||
'${ghcmgrurl}/builds/status-react/${utils.changeId()}'
|
||||
"""
|
||||
)
|
||||
}
|
||||
/* We're not using --fail because it suppresses server response */
|
||||
if (!stdout.contains('HTTP_CODE:201')) {
|
||||
error("Notifying GHCMGR failed with: ${httpCode}")
|
||||
println("STDOUT:\n${stdout}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ utils = load 'ci/utils.groovy'
|
|||
|
||||
def notify(message) {
|
||||
def githubIssuesUrl = 'https://api.github.com/repos/status-im/status-react/issues'
|
||||
def changeId = changeId()
|
||||
def changeId = utils.changeId()
|
||||
if (changeId == null) { return }
|
||||
def msgObj = [body: message]
|
||||
def msgJson = new JsonBuilder(msgObj).toPrettyString()
|
||||
|
|
|
@ -161,10 +161,11 @@ end
|
|||
|
||||
def upload_to_diawi(source)
|
||||
diawi(
|
||||
token: ENV["DIAWI_TOKEN"],
|
||||
file: source
|
||||
file: source,
|
||||
last_hope_attempts_count: 3,
|
||||
token: ENV["DIAWI_TOKEN"]
|
||||
)
|
||||
|
||||
# save the URL to a file for use in CI
|
||||
File.write("diawi.out", lane_context[SharedValues::UPLOADED_FILE_LINK_TO_DIAWI])
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue