Created
August 13, 2011 09:19
-
-
Save rummelonp/1143662 to your computer and use it in GitHub Desktop.
手元のGitリポジトリのprodブランチからrsync_with_remote_cacheを使ってrsyncでdeployする設定
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
set :application, "*** application name ***" | |
set :repository, "." | |
set :scm, :git | |
set :branch, "prod" | |
set :deploy_via, :rsync_with_remote_cache | |
role :app, "*** server address ***" | |
set :deploy_to, "/var/www/html/#{application}" | |
set :use_sudo, false | |
set :copy_exclude, open('.gitignore').readlines.map(&:strip) | |
set :rsync_options, '-az --delete --exclude=.git --exclude=' + copy_exclude.join(' --exclude=') | |
namespace :deploy do | |
task :restart, roles: :app do | |
run "touch #{current_release}/tmp/restart.txt" | |
end | |
task :bundle, roles: :app do | |
run "cd #{current_release}; #{sudo} /var/lib/gems/1.9.1/bin/bundle install" | |
end | |
after "deploy:update_code", roles: :app do | |
bundle | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment