Class: Capistrano::Deploy::Strategy::RemoteCacheWithSudo

Inherits:
RemoteCache
  • Object
show all
Defined in:
lib/capistrano/recipes/deploy/strategy/remote_cache_with_sudo.rb

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#update_repository_cacheObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/capistrano/recipes/deploy/strategy/remote_cache_with_sudo.rb', line 10

def update_repository_cache
  logger.trace "updating the cached checkout on all servers"
  if use_sudo
    sudo = "sudo"
  end
  command = "if [ -d #{repository_cache} ]; then " +
    "#{sudo} #{source.sync(revision, repository_cache)}; " +
    "else #{sudo} #{source.checkout(revision, repository_cache)}; fi"
  scm_run(command)
end