2016-12-12 15:57:39 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2017-07-17 09:55:39 +00:00
|
|
|
set -o pipefail
|
|
|
|
set -e
|
|
|
|
|
2016-12-12 15:57:39 +00:00
|
|
|
STEP_COLOR="\033[0;36m"
|
|
|
|
NO_COLOR="\033[0m"
|
|
|
|
|
|
|
|
function step {
|
|
|
|
echo -e ${STEP_COLOR}[$(date +%H:%M:%S)] $1${NO_COLOR}
|
|
|
|
}
|
|
|
|
|
|
|
|
### Determine what to push
|
|
|
|
|
2017-08-08 09:56:36 +00:00
|
|
|
step "Getting current branch"
|
2016-07-21 13:48:49 +00:00
|
|
|
|
2016-11-12 18:18:49 +00:00
|
|
|
CURRENT_BRANCH=$(git branch --list | awk '/^\*/{print $2}')
|
2016-12-12 15:57:39 +00:00
|
|
|
|
2017-08-08 09:56:36 +00:00
|
|
|
step "Loading required key to push"
|
|
|
|
git loadkey
|
|
|
|
|
2016-12-12 15:57:39 +00:00
|
|
|
step "Execute pre-push auto-hook"
|
|
|
|
git autohook pre-push
|
|
|
|
|
|
|
|
step "Execute pushes..."
|
2017-08-07 09:10:14 +00:00
|
|
|
git push origin ${CURRENT_BRANCH} --tags "$@"
|
2016-07-21 13:48:49 +00:00
|
|
|
|
2016-12-12 15:57:39 +00:00
|
|
|
step "Execute post-push auto-hook"
|
|
|
|
git autohook post-push
|