From 265da2a8b42bb2a7d59e36158478c1e2896e5232 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 24 Jul 2013 18:46:17 +0200 Subject: [PATCH] push back intregation branch if merge+build was successful --- maven_post_build_debian_wrapper.sh | 10 ++++++++++ maven_pre_build_debian_wrapper.sh | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/maven_post_build_debian_wrapper.sh b/maven_post_build_debian_wrapper.sh index 20d9745..18be926 100755 --- a/maven_post_build_debian_wrapper.sh +++ b/maven_post_build_debian_wrapper.sh @@ -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 diff --git a/maven_pre_build_debian_wrapper.sh b/maven_pre_build_debian_wrapper.sh index 6192b96..e4aaab9 100755 --- a/maven_pre_build_debian_wrapper.sh +++ b/maven_pre_build_debian_wrapper.sh @@ -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 "^\[") -- 2.39.5