Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to deploy from a git subdirectory (patch included) #5

Open
ex-nerd opened this issue Nov 9, 2010 · 0 comments
Open

Need to deploy from a git subdirectory (patch included) #5

ex-nerd opened this issue Nov 9, 2010 · 0 comments

Comments

@ex-nerd
Copy link

ex-nerd commented Nov 9, 2010

I have a need to deploy only a subtree from a git checkout. There is some churn in the upstream capistrano project about doing this, but it's enough for my needs to just adjust the path that rsync_with_remote_cache pulls from. I'm attaching my patch below, in case you're interested.

index ad44c22..a30fcaa 100644
--- rsync_with_remote_cache.rb
+++ rsync_with_remote_cache.rb
@@ -44,7 +44,12 @@ module Capistrano
         end

         def rsync_command_for(server)
-          "rsync #{rsync_options} --rsh='ssh -p #{ssh_port(server)}' #{local_cache_path}/ #{rsync_host(server)}:#{repository_cache_path}/"
+          if configuration[:app_root].nil? || configuration[:app_root].empty?
+            path = local_cache_path
+          else
+            path = "#{local_cache_path}/#{configuration[:app_root]}"
+          end
+          "rsync #{rsync_options} --rsh='ssh -p #{ssh_port(server)}' #{path}/ #{rsync_host(server)}:#{repository_cache_path}/"
         end

         def mark_local_cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant