From 6a90d76c9881b883e5c4a3da98ff042eb4771f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 13 Jan 2020 13:15:33 +0100 Subject: [PATCH] fix edge case where PR e2e builds are not rebased MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ci/android.groovy | 2 +- ci/common.groovy | 2 +- ci/ghcmgr.groovy | 2 +- ci/github.groovy | 2 +- ci/utils.groovy | 14 +++++++++++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ci/android.groovy b/ci/android.groovy index 31d55759dc..c4fb63b59c 100644 --- a/ci/android.groovy +++ b/ci/android.groovy @@ -71,7 +71,7 @@ def extractArchFromAPK(name) { if (matches.size() > 0) { return matches[0][1] } - if (utils.getBuildType() == 'e2e') { + if (utils.isE2EBuild()) { return 'x86' } /* non-release builds make universal APKs */ diff --git a/ci/common.groovy b/ci/common.groovy index 2d2931c2a8..3ce5f273f1 100644 --- a/ci/common.groovy +++ b/ci/common.groovy @@ -70,7 +70,7 @@ def uploadArtifact(path) { def domain = 'ams3.digitaloceanspaces.com' def bucket = 'status-im' /* There's so many PR builds we need a separate bucket */ - if (utils.getBuildType() == 'pr') { + if (utils.isPRBuild()) { bucket = 'status-im-prs' } /* WARNING: s3cmd can't guess APK MIME content-type */ diff --git a/ci/ghcmgr.groovy b/ci/ghcmgr.groovy index be451efdbe..37b10789b2 100644 --- a/ci/ghcmgr.groovy +++ b/ci/ghcmgr.groovy @@ -19,7 +19,7 @@ def buildObj(success) { id: env.BUILD_DISPLAY_NAME, commit: GIT_COMMIT.take(8), success: success != null ? success : true, - platform: env.TARGET + (utils.getBuildType() == 'e2e' ? '-e2e' : ''), + platform: env.TARGET + (utils.isE2EBuild() ? '-e2e' : ''), duration: utils.buildDuration(), url: currentBuild.absoluteUrl, pkg_url: pkg_url, diff --git a/ci/github.groovy b/ci/github.groovy index 3babb11730..54bcab5b33 100644 --- a/ci/github.groovy +++ b/ci/github.groovy @@ -60,7 +60,7 @@ def notifyPRFailure() { def notifyPRSuccess() { def d = ":small_blue_diamond:" def msg = "#### :heavy_check_mark: " - def type = ghcmgr.utils.getBuildType() == 'e2e' ? ' e2e' : '' + def type = ghcmgr.utils.isE2EBuild() ? ' e2e' : '' msg += "[${env.JOB_NAME}${currentBuild.displayName}](${currentBuild.absoluteUrl}) ${d} " msg += "${ghcmgr.utils.buildDuration()} ${d} ${GIT_COMMIT.take(8)} ${d} " msg += "[:package: ${env.TARGET}${type} package](${env.PKG_URL})" diff --git a/ci/utils.groovy b/ci/utils.groovy index a501ad0cea..e38f7573f9 100644 --- a/ci/utils.groovy +++ b/ci/utils.groovy @@ -31,7 +31,7 @@ def pkgFilename(type, ext, arch=null) { } def doGitRebase() { - if (getBuildType() != 'pr') { + if (!isPRBuild()) { println 'Skipping rebase due for non-PR build...' return } @@ -93,12 +93,20 @@ def pkgFind(glob) { return found[0].path } +def isPRBuild() { + return env.JOB_NAME.startsWith('status-react/prs') +} + +def isE2EBuild() { + return env.JOB_NAME.contains('e2e') +} + def getBuildType() { def jobName = env.JOB_NAME - if (jobName.contains('e2e')) { + if (isE2EBuild()) { return 'e2e' } - if (jobName.startsWith('status-react/prs')) { + if (isPRBuild()) { return 'pr' } if (jobName.startsWith('status-react/nightly')) {