From 738521092be391792d79277ca8d49608246518ff Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Fri, 22 Mar 2019 14:24:58 +0100 Subject: [PATCH] Call make-prepare also on Desktop CI builds Signed-off-by: Pedro Pombeiro --- ci/Jenkinsfile.android | 2 +- ci/Jenkinsfile.ios | 5 ++--- ci/Jenkinsfile.linux | 3 +-- ci/Jenkinsfile.macos | 3 +-- ci/Jenkinsfile.windows | 3 +-- ci/common.groovy | 32 ++++++++++++++++++++++++++++++++ ci/desktop.groovy | 5 ----- ci/mobile.groovy | 24 ------------------------ 8 files changed, 38 insertions(+), 39 deletions(-) diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index baf08cfdac..9ac1cff7a4 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -59,7 +59,7 @@ pipeline { print "Running ${btype} build!" cmn.ci.abortPreviousRunningBuilds() /* Cleanup and Prep */ - mobile.prep(btype) + cmn.prep(btype) } } } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index cb522bfe8e..564ba06c72 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -40,12 +40,11 @@ pipeline { /* Necessary to load methods */ mobile = load 'ci/mobile.groovy' cmn = load 'ci/common.groovy' - btype = cmn.utils.getBuildType() + btype = cmn.utils.getBuildType() print "Running ${btype} build!" cmn.ci.abortPreviousRunningBuilds() /* Cleanup and Prep */ - cmn.prepNixEnvironment() - mobile.prep(btype) + cmn.prep(btype) } } } diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index f846b9bfe7..b957f96dea 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -58,8 +58,7 @@ pipeline { print "Running ${btype} build!" cmn.ci.abortPreviousRunningBuilds() /* Cleanup and Prep */ - cmn.prepNixEnvironment() - desktop.prepDeps() + cmn.prep(btype) } } } diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 24f4562852..b9f1c01c17 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -42,8 +42,7 @@ pipeline { print "Running ${btype} build!" cmn.ci.abortPreviousRunningBuilds() /* Cleanup and Prep */ - cmn.prepNixEnvironment() - desktop.prepDeps() + cmn.prep(btype) } } } diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index 0548439ef4..cc69ed9946 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -61,8 +61,7 @@ pipeline { print "Running ${btype} build!" cmn.ci.abortPreviousRunningBuilds() /* Cleanup and Prep */ - cmn.prepNixEnvironment() - desktop.prepDeps() + cmn.prep(btype) } } } diff --git a/ci/common.groovy b/ci/common.groovy index 8b3ac86451..f98ed905ce 100644 --- a/ci/common.groovy +++ b/ci/common.groovy @@ -52,4 +52,36 @@ def prepNixEnvironment() { } } +def prep(type = 'nightly') { + prepNixEnvironment() + + utils.doGitRebase() + /* ensure that we start from a known state */ + sh 'make clean' + /* select type of build */ + switch (type) { + case 'nightly': + sh 'cp .env.nightly .env'; break + case 'release': + sh 'cp .env.prod .env'; break + case 'e2e': + sh 'cp .env.e2e .env'; break + default: + sh 'cp .env.jenkins .env'; break + } + if (env.TARGET_PLATFORM == 'android' || env.TARGET_PLATFORM == 'ios') { + /* Run at start to void mismatched numbers */ + utils.genBuildNumber() + /* install ruby dependencies */ + utils.nix_sh 'bundle install --quiet' + } + + def prepareTarget=env.TARGET_PLATFORM + if (env.TARGET_PLATFORM == 'macos' || env.TARGET_PLATFORM == 'linux' || env.TARGET_PLATFORM == 'windows') { + prepareTarget='desktop' + } + /* node deps, pods, and status-go download */ + utils.nix_sh "make prepare-${prepareTarget}" +} + return this diff --git a/ci/desktop.groovy b/ci/desktop.groovy index c949ca2fe0..69b3c31d09 100644 --- a/ci/desktop.groovy +++ b/ci/desktop.groovy @@ -42,11 +42,6 @@ def uploadArtifact(filename) { /* MAIN --------------------------------------------------*/ -def prepDeps() { - utils.doGitRebase() - cleanupAndDeps() -} - def compile() { /* disable logs for desktop builds when releasing */ if (params.BUILD_TYPE == 'release') { diff --git a/ci/mobile.groovy b/ci/mobile.groovy index 680e27f6a4..66352f2b34 100644 --- a/ci/mobile.groovy +++ b/ci/mobile.groovy @@ -1,28 +1,4 @@ ios = load 'ci/ios.groovy' -utils = load 'ci/utils.groovy' android = load 'ci/android.groovy' -def prep(type = 'nightly') { - utils.doGitRebase() - /* ensure that we start from a known state */ - sh 'make clean' - /* Run at start to void mismatched numbers */ - utils.genBuildNumber() - /* select type of build */ - switch (type) { - case 'nightly': - sh 'cp .env.nightly .env'; break - case 'release': - sh 'cp .env.prod .env'; break - case 'e2e': - sh 'cp .env.e2e .env'; break - default: - sh 'cp .env.jenkins .env'; break - } - /* install ruby dependencies */ - utils.nix_sh 'bundle install --quiet' - /* node deps, pods, and status-go download */ - utils.nix_sh "make prepare-${env.TARGET_PLATFORM}" -} - return this