Skip to content

Instantly share code, notes, and snippets.

@franciscomxs
Last active December 17, 2015 09:39
Show Gist options
  • Save franciscomxs/5589177 to your computer and use it in GitHub Desktop.
Save franciscomxs/5589177 to your computer and use it in GitHub Desktop.
Git Hooks
#!/bin/sh
cd /home/user/app/ || exit
unset GIT_DIR
git reset --hard
git pull origin master -f
bundle install --gemfile "Gemfile" --path "bundle" --deployment --without development test
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake assets:precompile
touch tmp/restart.txt
#!/bin/sh
cd /home/user/app/ || exit
unset GIT_DIR
kill $(cat tmp/pids/unicorn.pid)
git reset —hard
git pull origin master -f
bundle install —gemfile “Gemfile” —path “bundle” —deployment —without development test
bundle exec rake db:migrate RAILS_ENV=production
bundle exec unicorn -c config/unicorn.rb -D -E production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment