Simplify Jenkins files and remove needs for develop branch

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Julien Eluard 2018-02-28 08:38:38 +01:00
parent 1b86179a81
commit 4145a31a2d
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
5 changed files with 6 additions and 38 deletions

4
Jenkinsfile vendored
View File

@ -28,10 +28,6 @@ node ('macos1') {
slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL
checkout scm 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 'rm -rf node_modules'
sh 'cp .env.jenkins .env' sh 'cp .env.jenkins .env'

View File

@ -28,11 +28,9 @@ node ('macos1'){
stage('Git & Dependencies') { stage('Git & Dependencies') {
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL 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 checkout scm
sh 'git fetch --tags'
sh 'git checkout -- .'
sh 'git checkout develop'
sh 'rm -rf node_modules' sh 'rm -rf node_modules'
sh 'cp .env.jenkins .env' sh 'cp .env.jenkins .env'
sh 'lein deps' sh 'lein deps'

View File

@ -26,11 +26,9 @@ node ('macos1') {
stage('Git & Dependencies') { stage('Git & Dependencies') {
slackSend color: 'good', message: REPO + ":" + BRANCH_NAME + ' build started. ' + env.BUILD_URL 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 checkout scm
sh 'git checkout -- .'
sh 'git checkout develop'
sh 'git checkout ' + BRANCH_NAME
sh 'rm -rf node_modules' sh 'rm -rf node_modules'
sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."' sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."'

View File

@ -30,9 +30,6 @@ node ('macos1'){
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
checkout scm checkout scm
sh 'git checkout -- .'
sh 'git checkout remotes/origin/' + BRANCH_NAME
sh 'git fetch --tags'
sh 'rm -rf node_modules' sh 'rm -rf node_modules'
sh 'cp .env.prod .env' sh 'cp .env.prod .env'

View File

@ -6,8 +6,6 @@
# To use this script in Xcode, add the script's path to a "Run Script" build # To use this script in Xcode, add the script's path to a "Run Script" build
# phase for your application target. # 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 errexit
set -o nounset set -o nounset
@ -50,30 +48,11 @@ else
IFS=$OLD_IFS IFS=$OLD_IFS
fi 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: # For debugging:
echo "BUILD VERSION: $BUILD_VERSION" echo "BUILD VERSION: $BUILD_VERSION"
echo "LATEST_TAG: $LATEST_TAG" echo "LATEST_TAG: $LATEST_TAG"
echo "COMMIT_COUNT_SINCE_TAG: $COMMIT_COUNT_SINCE_TAG" echo "COMMIT_COUNT_SINCE_TAG: $COMMIT_COUNT_SINCE_TAG"
echo "SHORT VERSION: $SHORT_VERSION" 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 "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 :CFBundleShortVersionString $SHORT_VERSION" "$INFO_PLIST"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUNDLE_VERSION" "$INFO_PLIST"