Created
April 9, 2014 23:42
-
-
Save S0c5/10330613 to your computer and use it in GitHub Desktop.
git-update-receive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -l | |
APP_PATH=/home/ubuntu/www | |
GIT_WORK_TREE=$APP_PATH | |
export GIT_WORK_TREE | |
export PADRINO_ENV="production" | |
export RACK_ENV="production" | |
exit_with_error(){ | |
echo "[DEPLOY] !!!!!!!!!!!!!!!!!!!! Un error ah ocurrido !!!!!!!!!!!!!!!!!!!!!!!" | |
exit 1 | |
} | |
echo "**********************************************************************" | |
echo " Deploying application... " | |
echo "**********************************************************************" | |
echo "[DEPLOY] - * Updating application working tree" | |
git checkout -f | |
echo "[DEPLOY] - * Running bundle" | |
cd $APP_PATH | |
bundle install | |
echo "[DEPLOY] - * Restarting application" | |
mkdir -p tmp/ | |
touch tmp/restart.txt | |
echo "[DEPLOY] - * Update crontab" | |
whenever --update-crontab | |
echo "[DEPLOY] - * Successfully deployed application to ${APP_PATH}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Un error ha ocurrido