Skip to content

Instantly share code, notes, and snippets.

@yiyizym
Created February 10, 2018 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yiyizym/65b246cc2621fb1810a437906d52c37a to your computer and use it in GitHub Desktop.
Save yiyizym/65b246cc2621fb1810a437906d52c37a to your computer and use it in GitHub Desktop.
waraimasu_deploy.sh
#!/bin/sh
root_dir='/home/admin/waraimasu/'
echo "跳转到根目录 ${root_dir}"
cd $root_dir
echo "ok"
echo "拉 master 最新代码"
git pull origin master
echo "ok"
echo "重新编译静态资源"
RAILS_ENV=production NODE_ENV=production rake assets:precompile
echo "ok"
echo "杀死之前的 puma 进程"
ps -ef | grep PROCESS | grep -v grep | awk '{print $2}' | xargs kill -9
echo "ok"
echo "重启 puma"
RAILS_ENV=production puma -d
echo "ok"
echo "done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment