ubuntu, ror, jQuery, css, website memo
太嫩, 沒啥心得, 用來紀錄每天學的
2009年7月16日 星期四
capistrano, fast_remote_cache
fast_remote_cache
37signals 用hard link 取代 copy 的方式
因為有需要一直用新的branch 更新, cache_copy 有需要一直變換其svn repository
所以需要overwrite 一下 fast_remote_cache 的一些 methods
#lib/capistrano/recipes/deploy/strategy<br />/fast_remote_cache.rb<br /><br /> def deploy!<br /> prepare!<br /> copy_repository_cache<br /> end<br /><br /> def prepare!<br /> switch_repository_cache<br /> update_repository_cache<br /> end<br /><br /> private<br /><br /> def switch_repository_cache<br /> logger.trace "switching the cached checkout on all servers"<br /> command = "if [ -d #{repository_cache} ]; then " +<br /> "#{source.switch(repository, repository_cache)}; " +<br /> "fi"<br /> scm_run(command)<br /> end<br /><br />require 'capistrano/recipes/deploy/scm/subversion'<br />class Capistrano::Deploy::SCM::Subversion<br /> def switch(url,destination)<br /> logger.trace "switch #{destination} to #{url}"<br /> scm :switch, arguments, verbose, authentication, url, destination<br /> end<br />end<br /><br />
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
Tweet
t
沒有留言:
張貼留言