From 4145a31a2d46aebf77580b01db5b6a3f1c2ced54 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Wed, 28 Feb 2018 08:38:38 +0100 Subject: [PATCH] Simplify Jenkins files and remove needs for develop branch Signed-off-by: Julien Eluard --- Jenkinsfile | 4 ---- Jenkinsfile.nightly | 8 +++----- Jenkinsfile.parameters | 8 +++----- Jenkinsfile.release | 3 --- ios/scripts/set_xcode_version.sh | 21 --------------------- 5 files changed, 6 insertions(+), 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f8e67339a..29a3648d4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,10 +28,6 @@ node ('macos1') { slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL checkout scm - sh 'git checkout -- .' - sh 'git checkout develop' - sh 'git checkout remotes/origin/' + BRANCH_NAME - sh 'git rebase origin/develop' sh 'rm -rf node_modules' sh 'cp .env.jenkins .env' diff --git a/Jenkinsfile.nightly b/Jenkinsfile.nightly index 7dfb41dbc2..8a607dbdc9 100644 --- a/Jenkinsfile.nightly +++ b/Jenkinsfile.nightly @@ -28,11 +28,9 @@ node ('macos1'){ stage('Git & Dependencies') { slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL - git([url: 'https://github.com/status-im/status-react.git', branch: 'develop']) - // Checkout master because used for iOS Plist version information - sh 'git fetch --tags' - sh 'git checkout -- .' - sh 'git checkout develop' + + checkout scm + sh 'rm -rf node_modules' sh 'cp .env.jenkins .env' sh 'lein deps' diff --git a/Jenkinsfile.parameters b/Jenkinsfile.parameters index f7d32fef68..09937adb06 100644 --- a/Jenkinsfile.parameters +++ b/Jenkinsfile.parameters @@ -26,11 +26,9 @@ node ('macos1') { stage('Git & Dependencies') { slackSend color: 'good', message: REPO + ":" + BRANCH_NAME + ' build started. ' + env.BUILD_URL - git([url: 'https://github.com/' + REPO + '/status-react.git', branch: BRANCH_NAME]) - // Checkout master because used for iOS Plist version information - sh 'git checkout -- .' - sh 'git checkout develop' - sh 'git checkout ' + BRANCH_NAME + + checkout scm + sh 'rm -rf node_modules' sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."' diff --git a/Jenkinsfile.release b/Jenkinsfile.release index c267cfa82c..134b3c792d 100644 --- a/Jenkinsfile.release +++ b/Jenkinsfile.release @@ -30,9 +30,6 @@ node ('macos1'){ slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL checkout scm - sh 'git checkout -- .' - sh 'git checkout remotes/origin/' + BRANCH_NAME - sh 'git fetch --tags' sh 'rm -rf node_modules' sh 'cp .env.prod .env' diff --git a/ios/scripts/set_xcode_version.sh b/ios/scripts/set_xcode_version.sh index dbc5cd74f0..3b8b3f5f83 100755 --- a/ios/scripts/set_xcode_version.sh +++ b/ios/scripts/set_xcode_version.sh @@ -6,8 +6,6 @@ # To use this script in Xcode, add the script's path to a "Run Script" build # phase for your application target. -MAIN_GIT_BRANCH="develop" # status-react uses develop instead of master as the main dev tree - set -o errexit set -o nounset @@ -50,30 +48,11 @@ else IFS=$OLD_IFS fi -# Bundle version (commits-on-master[-until-branch "." commits-on-branch]) -# Assumes that two release branches will not diverge from the same commit on master. -if [ $(git rev-parse --abbrev-ref HEAD) = "$MAIN_GIT_BRANCH" ]; then - MASTER_COMMIT_COUNT=$(git rev-list --count HEAD) - BRANCH_COMMIT_COUNT=0 - BUNDLE_VERSION="$MASTER_COMMIT_COUNT" -else - MASTER_COMMIT_COUNT=$(git rev-list --count $(git rev-list ${MAIN_GIT_BRANCH}.. | tail -n 1)^) - BRANCH_COMMIT_COUNT=$(git rev-list --count ${MAIN_GIT_BRANCH}..) - if [ $BRANCH_COMMIT_COUNT = 0 ] - then BUNDLE_VERSION="$MASTER_COMMIT_COUNT" - else BUNDLE_VERSION="${MASTER_COMMIT_COUNT}.${BRANCH_COMMIT_COUNT}" - fi -fi - # For debugging: echo "BUILD VERSION: $BUILD_VERSION" echo "LATEST_TAG: $LATEST_TAG" echo "COMMIT_COUNT_SINCE_TAG: $COMMIT_COUNT_SINCE_TAG" echo "SHORT VERSION: $SHORT_VERSION" -echo "MASTER_COMMIT_COUNT: $MASTER_COMMIT_COUNT" -echo "BRANCH_COMMIT_COUNT: $BRANCH_COMMIT_COUNT" -echo "BUNDLE_VERSION: $BUNDLE_VERSION" /usr/libexec/PlistBuddy -c "Add :CFBundleBuildVersion string $BUILD_VERSION" "$INFO_PLIST" 2>/dev/null || /usr/libexec/PlistBuddy -c "Set :CFBundleBuildVersion $BUILD_VERSION" "$INFO_PLIST" /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_VERSION" "$INFO_PLIST" -/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUNDLE_VERSION" "$INFO_PLIST"