16. 例)common-deploy.rb
desc "Update remote files"
task :update do |o|
run "mkdir -p #{releases_path}"
strategy.deploy!
if ENV['ROLES'] =~ /proxy/ && server_type ==
'daemontools'
puts "### SEEMS LIKE PROXY; UPDATE CURRENT ###"
daemontools.update_current
end
if ENV['ROLES'] && update_timestamp_filter && !
update_timestamp_filter.include?(ENV['ROLES'])
update_static_timestamps
end
end
30. git設定
set :scm, :git # git使う
set :git_shallow_clone, 1 # depth=1でやってくれる
set :git_enable_submodules, 1 # submoduleも
set :branch, "master"
set :repository do
"git@host:projects/Hoge.git"
end
40. roleを動的定義する
task '@production' do
role :app, 'production01.host'
role :cron, 'production01.host'
end
task '@development' do
role :app, 'development01.host'
role :cron, 'development01.host'
end