From: Holger Levsen Date: Wed, 24 Jul 2013 16:46:17 +0000 (+0200) Subject: push back intregation branch if merge+build was successful X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=265da2a8b42bb2a7d59e36158478c1e2896e5232;p=profitbricks%2Fjenkins-build-scripts.git push back intregation branch if merge+build was successful --- 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 "^\[")