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