diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-18 10:25:08 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-18 10:25:08 +0200 |
commit | 2e9af82da4ad1da37fb360338dd4b447fadce184 (patch) | |
tree | 8fae2890d77089a90ed5b031f210862240329706 /push.sh | |
parent | a1e07f5c336053e7be542c331be87459607e06e5 (diff) | |
download | sonarqube-2e9af82da4ad1da37fb360338dd4b447fadce184.tar.gz sonarqube-2e9af82da4ad1da37fb360338dd4b447fadce184.zip |
Replace push.sh by https://github.com/SonarSource/sonar-developer-toolset/blob/master/git/git-push
Diffstat (limited to 'push.sh')
-rwxr-xr-x | push.sh | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/push.sh b/push.sh deleted file mode 100755 index d78c871f585..00000000000 --- a/push.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# Unbreakable build - -function alert_user { -echo "${1}" -which -s osascript && osascript -e "display notification \"${1}\" with title \"SonarQube -- Build\"" -which -s growlnotify && growlnotify `basename $0` -m "${1}" -} - -function exit_ko { -alert_user "${1}"; exit 1 -} - -function exit_ok { -alert_user "${1}"; exit 0 -} - -LOCATION=$(pwd) -REMOTE=${1:-origin} -REMOTE_URL=$(git remote show -n ${REMOTE} | awk '/Fetch/ {print $3}') -BRANCH=$(git symbolic-ref -q HEAD) -BRANCH=${BRANCH##refs/heads/} - -# Git black magic to pull rebase even with uncommited work in progress -git fetch ${REMOTE} -git add -A; git ls-files --deleted -z | xargs -0 -I {} git rm {}; git commit -m "wip" -git rebase ${REMOTE}/${BRANCH} - -if [ "$?" -ne 0 ]; then -git rebase --abort -git log -n 1 | grep -q -c "wip" && git reset HEAD~1 -exit_ko "Unable to rebase. please pull or rebase and fix conflicts manually." -fi -git log -n 1 | grep -q -c "wip" && git reset HEAD~1 - -# Private build -rm -Rf ../privatebuild -git clone --single-branch -slb "${BRANCH}" . ../privatebuild -cd ../privatebuild - -# Build with maven -set MAVEN_OPTS=-Xmx256m -mvn -T4 clean install -if [ $? -ne 0 ]; then -exit_ko "Unable to build" -fi - -# Push -git push ${REMOTE_URL} ${BRANCH} -if [ $? -ne 0 ]; then -exit_ko "Unable to push" -fi - -# Update working directory -cd ${LOCATION} && git fetch ${REMOTE} -exit_ok "Yet another successful build!" |