From edd58af80bb1efc5a765a779130781782c21228f Mon Sep 17 00:00:00 2001 From: Anton Danchenko Date: Thu, 30 Aug 2018 13:46:37 +0300 Subject: [PATCH] apk name is a PR number if build for a PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ci/android.groovy | 7 ++++++- ci/common.groovy | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/android.groovy b/ci/android.groovy index e90121f790..180b25b7b2 100644 --- a/ci/android.groovy +++ b/ci/android.groovy @@ -38,7 +38,12 @@ def uploadToPlayStore() { } def uploadToSauceLabs() { - env.SAUCE_LABS_APK = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk" + 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'), diff --git a/ci/common.groovy b/ci/common.groovy index 2e98b083ea..ffffd5d273 100644 --- a/ci/common.groovy +++ b/ci/common.groovy @@ -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