Skip to content

Instantly share code, notes, and snippets.

@webframp
Created November 2, 2012 18:12
Show Gist options
  • Save webframp/4003290 to your computer and use it in GitHub Desktop.
Save webframp/4003290 to your computer and use it in GitHub Desktop.
copy_cached_repo.rb
Chef::Log.info '** Patching deploy resource copy method to use rsync **'
class Chef::Provider::Deploy
def copy_cached_repo
FileUtils.mkdir_p(@new_resource.deploy_to + "/releases")
run_command(:command => "rsync -a --exclude '.git*' #{::File.join(@new_resource.destination, ".")}/ #{release_path}")
Chef::Log.info "#{@new_resource} copied the cached checkout to #{release_path} using rsync"
release_created(release_path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment