diff --git a/Jenkinsfile b/Jenkinsfile index a01c2eb4d6..b989f283c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,12 +58,16 @@ node ('macos1') { } 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() sh 'sleep 10' 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 + 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) } } @@ -75,12 +79,16 @@ node ('macos1') { } 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() sh 'sleep 10' 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 + 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) } }