Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions lib/capistrano/recipes/deploy/strategy/rsync_with_remote_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,40 @@ def self.default_attribute(attribute, default_value)

def deploy!
update_local_cache
build
update_remote_cache
copy_remote_cache
end

def execute description, &block
logger.debug description
handle_system_errors &block
end

def handle_system_errors &block
block.call
raise_command_failed if last_command_failed?
end

def raise_command_failed
raise Capistrano::Error, "shell command failed with return code #{$?}"
end

def last_command_failed?
$? != 0
end

def build_script
configuration[:build_script]
end

def build
return unless build_script
execute "running build script on #{local_cache_path}" do
Dir.chdir(local_cache_path) { system(build_script) }
end
end

def update_local_cache
system(command)
mark_local_cache
Expand Down