wgs6gw
Last Updated: September 27, 2016
·
5.231K
· boris
Beer avatar

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
Say Thanks