Skip to content

Instantly share code, notes, and snippets.

@S0c5
Created April 9, 2014 23:42
Show Gist options
  • Save S0c5/10330613 to your computer and use it in GitHub Desktop.
Save S0c5/10330613 to your computer and use it in GitHub Desktop.
git-update-receive
#!/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}"
@sirgalleto
Copy link

Un error ha ocurrido

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment