Skip to content

Commit

Permalink
split uploads task into push/pull
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewhitehouse committed Oct 16, 2014
1 parent 89c0ba2 commit 57e5c5b
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions lib/capistrano/tasks/content.cap
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
namespace :uploads do

desc "Syncs uploads directory from local to remote"
task :sync do

run_locally do
roles(:all).each do |role|

execute :rsync, "-avzO #{role.user}@#{role.hostname}:#{shared_path}/content/uploads/ content/uploads"
execute :rsync, "-avzO content/uploads/ #{role.user}@#{role.hostname}:#{shared_path}/content/uploads"

end
end
desc "Push any changed or new files from local to remote"
task :push do
run_locally do
roles(:all).each do |role|
execute :rsync, "-avzO content/uploads/ #{role.user}@#{role.hostname}:#{shared_path}/content/uploads"
end
end
end

desc "Pull any changed or new files from remote to local"
task :pull do
run_locally do
roles(:all).each do |role|
execute :rsync, "-avzO #{role.user}@#{role.hostname}:#{shared_path}/content/uploads/ content/uploads"
end
end
end

end

0 comments on commit 57e5c5b

Please sign in to comment.