Module: Capistrano::Git::RsyncStrategy
- Defined in:
- lib/capistrano/deploy_rsync.rb
Instance Method Summary collapse
- #check ⇒ Object
- #clone ⇒ Object
- #fetch_revision ⇒ Object
- #release ⇒ Object
-
#rsync(*args) ⇒ Object
execute rsync in context with arguments.
- #test ⇒ Object
- #update ⇒ Object
Instance Method Details
#check ⇒ Object
16 17 18 |
# File 'lib/capistrano/deploy_rsync.rb', line 16 def check puts "Nothing to check" end |
#clone ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/capistrano/deploy_rsync.rb', line 20 def clone on roles(:all) do |role| run_locally do execute "rsync", "-avz", "dist/", "#{role.user}@#{role.hostname}:#{repo_path}" end end end |
#fetch_revision ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/capistrano/deploy_rsync.rb', line 38 def fetch_revision run_locally do IO.popen ("git rev-list --max-count=1 --abbrev-commit #{fetch(:branch)}") do |f| set :current_revision, f.gets end end end |
#release ⇒ Object
32 33 34 35 36 |
# File 'lib/capistrano/deploy_rsync.rb', line 32 def release on roles(:all) do execute :cp, '-r', "#{repo_path}/", "#{release_path}/dist" end end |
#rsync(*args) ⇒ Object
execute rsync in context with arguments
7 8 9 10 |
# File 'lib/capistrano/deploy_rsync.rb', line 7 def rsync(*args) args.unshift(:rsync) context.execute *args end |
#test ⇒ Object
12 13 14 |
# File 'lib/capistrano/deploy_rsync.rb', line 12 def test puts "Nothings to test" end |
#update ⇒ Object
28 29 30 |
# File 'lib/capistrano/deploy_rsync.rb', line 28 def update clone end |