ubuntu, ror, jQuery, css, website memo
太嫩, 沒啥心得, 用來紀錄每天學的
2009年6月17日 星期三
git github capistrano in hostingrails
github Guides: Deploying with Capistrano feed
How to Deploy Rails Using Git with Capistrano on Mongrel with HostingRails
Using Capistrano with Passenger (mod_rails)
my deploy.rb
set :application, 'app_name'
#user for ssh login
set :user, 'hostingrails-username'
default_run_options[:pty] = true
set :repository, "github repository"
set :scm, "git"
set :git_account, 'github username'
set :scm_passphrase, "github password" #This is your custom users password
set :branch, "master"
set :deploy_via, :remote_cache
set :git_shallow_clone, 1
set :git_enable_submodules, 1
set :use_sudo, false
set :deploy_to, "/home/#{user}/deploy"
set :shared_children, %w(system log pids mugshots)
after 'deploy:update_code', 'iwakela:extra_setting'
role :web, 'example.com'
role :app, 'example.com'
role :db, 'example.com', :primary => true
namespace :example do
task :extra_setting do
run <<-CMD
rm -rf #{latest_release}/public/mugshots &&
mkdir -p #{latest_release}/public &&
ln -s #{shared_path}/mugshots #{latest_release}/public/mugshots
CMD
db_config = "#{current_path}/config/database.online.yml"
run "cp #{db_config} #{current_path}/config/database.yml;"
end
task :update do
deploy::update
end
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
備忘
#把deploy.rb 生出來
capify .
#把目錄建一建, 像shared 下面那些
cap deploy:setup
#好物 爆了 快用
cap deploy:rollback
#use_sudo defaults to true. Capistrano often needs to run commands under the root user. You can suppress this behavior by setting
set :use_sudo, false
#:run_method defaults to :sudo. Capistrano uses this option to determine
#whether the cap deploy:restart should run under the current
#user (specify the :run value) or root (specify the :sudo option).
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言