penchant/script/hooks/commit-msg

24 lines
407 B
Plaintext
Raw Normal View History

2012-04-20 15:12:56 +00:00
#!/bin/bash
msg=$(cat $1)
OLD_GIT_DIR=$GIT_DIR
if [[ "${msg}" != *"[ci skip]"* ]]; then
if [ "$(penchant gemfile-env)" != "remote" ]; then
penchant gemfile remote
fi
bundle exec rake
R=$?
if [ $R -ne 0 ]; then exit $R; fi
fi
if [ "$(penchant gemfile-env)" != "remote deployment" ]; then
unset GIT_DIR
penchant gemfile remote --deployment
GIT_DIR=$OLD_GIT_DIR
git add Gemfile*
fi