]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
maven_pre_helper: properly reset master branch. refactor a bit.
authorHolger Levsen <holger@layer-acht.org>
Fri, 23 Aug 2013 09:54:11 +0000 (11:54 +0200)
committerHolger Levsen <holger@layer-acht.org>
Fri, 23 Aug 2013 09:54:11 +0000 (11:54 +0200)
maven_pre_build_debian_wrapper.sh

index 9e9b603f0d2633ac8c22e2be1f14e8caf09d578c..0dd5646e33b6f526062941200598e02cf32b95fb 100755 (executable)
@@ -23,9 +23,14 @@ if [[ "$BUILD_TRIGGERS" == *"no-test"* ]]; then
 fi
 export
 
+echo "Fetching from remote..."
+git fetch origin --prune
 echo "About to build branch:"
 figlet "$GIT_BRANCH_NAME"
 git checkout $GIT_BRANCH_NAME
+echo "Resetting $GIT_BRANCH_NAME branch to remote state..."
+git reset --hard refs/remotes/origin/$GIT_BRANCH_NAME
+echo
 git status
 
 if [[ ${GIT_BRANCH_NAME:0:8} = "feature/" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]]; then
@@ -36,8 +41,6 @@ if [[ ${GIT_BRANCH_NAME:0:8} = "feature/" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "bug
         #
         echo "Switching to integration branch..."
         git checkout integration
-        echo "Fetching from remote..."
-        git fetch origin --prune
         echo "Resetting integration branch to remote state..."
         git reset --hard refs/remotes/origin/integration
         figlet "integration merge"
@@ -51,10 +54,5 @@ elif [[ "$GIT_BRANCH_NAME" = "master" ]] || [[ "${GIT_BRANCH_NAME:0:7}" = "hotfi
     TAG=$(echo $VERSION | tr '~' '_' | tr ':' ',')
     git tag $TAG -m "Testing whether there is already a tag $TAG..."
     git tag -d $TAG
-elif [[ "$GIT_BRANCH_NAME" = "integration" ]] ; then
-        echo "Fetching from remote..."
-        git fetch origin --prune
-        echo "Resetting integration branch to remote state..."
-        git reset --hard refs/remotes/origin/integration
 fi