Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple bash script to update & restart a rails app on a live dev server when triggered by a webhook set to repo push. Args to script are:,,
echo "commit: $1 by: $2 $3"
cd your/git_rails/project_root #REPLACE THIS
git pull
if [ -f tmp/pids/ ]; then
echo "killing rails server"
kill -9 $(cat tmp/pids/
bundle install
rails db:migrate RAILS_ENV=development
rails s -b -d
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment