Task #PBP-6319 - Fix Jenkins pre- and post-commit triggers
[[ -d .repository ]] && rm .repository -rf && echo "$WORKSPACE/.repository (used by Maven) removed"
# clean up git
git reset --hard
+git clean -xf
# respect build-triggers (triggered from a git commit message containing the string [no-test])
if [[ "$BUILD_TRIGGERS" == *"no-test"* ]]; then
export NO_TEST="true"
git checkout $GIT_BRANCH_NAME
echo "Resetting $GIT_BRANCH_NAME branch to remote state..."
git reset --hard refs/remotes/origin/$GIT_BRANCH_NAME
+git clean -xf
echo
git status
git checkout integration
echo "Resetting integration branch to remote state..."
git reset --hard refs/remotes/origin/integration
+ git clean -xf
figlet "integration merge"
git merge --no-ff origin/$GIT_BRANCH_NAME
fi