apk name is a PR number if build for a PR

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Anton Danchenko 2018-08-30 13:46:37 +03:00 committed by Jakub Sokołowski
parent 789a905743
commit edd58af80b
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 12 additions and 1 deletions

View File

@ -38,7 +38,12 @@ def uploadToPlayStore() {
}
def uploadToSauceLabs() {
def changeId = common.getParentRunEnv('CHANGE_ID')
if (changeId != null) {
env.SAUCE_LABS_APK = "${changeId}.apk"
} else {
env.SAUCE_LABS_APK = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
}
withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),

View File

@ -151,4 +151,10 @@ def githubNotify(apkUrl, e2eUrl, ipaUrl, dmgUrl, appUrl, changeId) {
}
}
def getParentRunEnv(name) {
def c = currentBuild.rawBuild.getCause(hudson.model.Cause$UpstreamCause)
if (c == null) { return null }
return c.getUpstreamRun().getEnvironment()[name]
}
return this