Last Updated: September 27, 2016
·
9.691K
· boris

Copy local files to remote server using capistrano 3

With this nice and easy pro-tip you could copy configuration files (among other) to your #{shared_path} using a capistrano task.

It was tested only on Capistrano 3

namespace :devops do
   desc "Copy files"
   task :copy do
      on roles(:all) do |host|
         %w[ file.one file.two ].each do |f|
            upload! '/path/fo/file/' + f , '/remote/path/' + f
         end
      end
   end
end