Webistrano + rsync のメモ

  • webistrano のバージョン。割と最近のです。
commit a98ba6b161ee5aedf4b7198a0a909be32bb0b9a6
Author: Jonathan Weiss <jw@innerewut.de>
Date:   Fri May 20 21:18:11 2011 +0200
  • 最近の Webistrano は bundler に対応したので、Gemfile に gem を追加。直接読み込めなかったので、git のソースを指定して、$ bundle
gem "capistrano_rsync_with_remote_cache", :git => "git://github.com/luisparravicini/capistrano_rsync_with_remote_cache.git", :branch => "v2.3.6"
set :scm, :git
set :deploy_via, :rsync_with_remote_cache
set :git_enable_submodules, true
set :local_cache, "/var/cache/webistrano/[repository_name]"
set :repository, "ssh://git@gitserver.local/path/to/repository.git" # repository は今まで通り
set :rsync_options, '-a --delete --delete-excluded --exclude=.git'
  • リンク先とほとんど同じですが、local_cache だけ適当な場所を指定しないと、Webistrano の APP_ROOT に .rsync_cache が作られるので、指定した。
  • あとは rsync の鍵通して、今まで5分くらいかかってたのが15秒くらいでデプロイできるようになりました。すばらしい。