lib/capistrano/bundle_rsync/git.rb in capistrano-bundle_rsync-0.4.0 vs lib/capistrano/bundle_rsync/git.rb in capistrano-bundle_rsync-0.4.1
- old
+ new
@@ -1,6 +1,7 @@
require 'capistrano/bundle_rsync/scm'
+require 'capistrano/configuration/filter'
class Capistrano::BundleRsync::Git < Capistrano::BundleRsync::SCM
def check
exit 1 unless execute("git ls-remote #{repo_url}")
execute("mkdir -p #{config.local_base_path}")
@@ -33,10 +34,10 @@
end
end
end
def rsync_release
- hosts = release_roles(:all)
+ hosts = ::Capistrano::Configuration.env.filter(release_roles(:all))
rsync_options = config.rsync_options
Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host|
ssh = config.build_ssh_command(host)
execute :rsync, "#{rsync_options} --rsh='#{ssh}' #{config.local_release_path}/ #{host}:#{release_path}/"
end