Fixes #3456: Publish diawi links in relevant PR

This commit is contained in:
pacamara 2018-05-09 00:23:06 +01:00 committed by Roman Volosovskyi
parent 8369afdddc
commit 89632bea1b
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 10 additions and 2 deletions

12
Jenkinsfile vendored
View File

@ -58,12 +58,16 @@ node ('macos1') {
} }
stage('Deploy (Android)') { stage('Deploy (Android)') {
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) { withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')] ) {
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() 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' 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 = 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 apkUrl = 'https://i.diawi.com/' + hash
def commentMsg = "apk uploaded to " + apkUrl + " for branch " + BRANCH_NAME
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
println("Result of github comment curl: " + ghOutput)
sh ('echo ARTIFACT Android: ' + apkUrl) sh ('echo ARTIFACT Android: ' + apkUrl)
} }
} }
@ -75,12 +79,16 @@ node ('macos1') {
} }
stage('Deploy (iOS)') { stage('Deploy (iOS)') {
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) { withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) {
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() 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' 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 = 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 ipaUrl = 'https://i.diawi.com/' + hash
def commentMsg = "ipa uploaded to " + ipaUrl + " for branch " + BRANCH_NAME
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
println("Result of github comment curl: " + ghOutput)
sh ('echo ARTIFACT iOS: ' + ipaUrl) sh ('echo ARTIFACT iOS: ' + ipaUrl)
} }
} }