Skip to content

Instantly share code, notes, and snippets.

@erlingur
Created May 30, 2014 16:37
Show Gist options
  • Save erlingur/027800a726cb71a367af to your computer and use it in GitHub Desktop.
Save erlingur/027800a726cb71a367af to your computer and use it in GitHub Desktop.
Capistrano upload task
namespace :deploy do
task :upload do
files = (ENV["FILES"] || "").split(",").map { |f| Dir[f.strip] }.flatten
abort "Please specify at least one file or directory to update (via the FILES environment variable)" if files.empty?
on release_roles :all do
files.each { |file| upload!(file, File.join(current_path, file)) }
end
end
end
@drummerroma
Copy link

Add recursive: true

files.each { |file| upload!(file, File.join(current_path, file), recursive: true) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment