]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
push back intregation branch if merge+build was successful
authorHolger Levsen <holger@layer-acht.org>
Wed, 24 Jul 2013 16:46:17 +0000 (18:46 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 24 Jul 2013 16:46:17 +0000 (18:46 +0200)
maven_post_build_debian_wrapper.sh
maven_pre_build_debian_wrapper.sh

index 20d974510d98651946ec2f894547c104201514d1..18be926a102aa4c741eae9f9a23e886c34350ca1 100755 (executable)
@@ -102,6 +102,7 @@ if [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]
        git push origin $TAG
 fi
 
+
 # upload to reprepro
 # TODO: implement
 
@@ -111,5 +112,14 @@ dpkg-parsechangelog
 set +x
 cleanup
 
+# push back integration branch if we merged a feature branch
+if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then
+        if [[ "$BUILD_TRIGGERS" == *"merge"* ]]; then
+               git push origin integration
+               git checkout origin/$GIT_BRANCH_NAME -b $GIT_BRANCH_NAME
+       fi
+fi
+
+
 #TODO: remove this debug output
 export
index 6192b9674db133ae3275704a1251df59b61d3762..e4aaab9d6119ca197e8f1143f1f9284d7be14d1d 100755 (executable)
@@ -2,12 +2,14 @@
 
 set -e
 
+git reset --hard
+
 if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then
        if [[ "$BUILD_TRIGGERS" == *"merge"* ]]; then
                echo "Switching to integration branch..."
                git checkout integration
                echo "Trying to fast-forward merge $GIT_BRANCH_NAME..."
-               git merge --no-ff $GIT_BRANCH_NAME
+               git merge --no-ff origin/$GIT_BRANCH_NAME
        fi
 elif [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ] ; then
        VERSION=$(mvn -B -N help:evaluate -Dexpression=project.version 2>/dev/null| grep -v "^\[")