Skip to content

Instantly share code, notes, and snippets.

@happypeter
Last active October 10, 2015 04:38
Show Gist options
  • Save happypeter/3634487 to your computer and use it in GitHub Desktop.
Save happypeter/3634487 to your computer and use it in GitHub Desktop.
deploy happycasts on my linode vps
#!/usr/bin/env bash
ssh -t [email protected] '
source ~/.bash_login && cd ~/happycasts && \
git pull && \
bundle exec rake db:migrate RAILS_ENV=production; \
bundle && bundle exec rake assets:precompile &&\
touch tmp/restart.txt
'
##
# run .bash_login (or maybe .profile) to make rvm work, otherwise 'bundle command not found'
#
# -t to bring the password prompt, when you use sudo
##
@tylerlong
Copy link

这种任务用capistrano是最合适的.

@yesmeck
Copy link

yesmeck commented Sep 5, 2012

我觉的要向多个服务器部署的时候 capistrano 会比较有用,不然用一个脚本好像也没什么麻烦。

@happypeter
Copy link
Author

capistrano 还没学会呢 😄

@happypeter
Copy link
Author

七个月过去了,中间用了 capistrano 一段时间,感觉好麻烦。所以最终切换回了脚本这种傻瓜透明的方式。

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