Module: Capistrano::Git::PushStrategy
- Defined in:
- lib/capistrano/git/push_strategy.rb
Instance Method Summary collapse
- #check ⇒ Object
- #clone ⇒ Object
- #fetch_revision ⇒ Object
- #release ⇒ Object
- #test ⇒ Object
- #update ⇒ Object
Instance Method Details
#check ⇒ Object
15 16 17 18 19 |
# File 'lib/capistrano/git/push_strategy.rb', line 15 def check run_locally do test 'git show-ref' end end |
#clone ⇒ Object
21 22 23 |
# File 'lib/capistrano/git/push_strategy.rb', line 21 def clone git :init, '--bare', repo_path end |
#fetch_revision ⇒ Object
37 38 39 |
# File 'lib/capistrano/git/push_strategy.rb', line 37 def fetch_revision context.capture(:git, 'rev-parse --short master') end |
#release ⇒ Object
33 34 35 |
# File 'lib/capistrano/git/push_strategy.rb', line 33 def release git :archive, 'master', '| tar -x -f - -C', release_path end |
#test ⇒ Object
11 12 13 |
# File 'lib/capistrano/git/push_strategy.rb', line 11 def test test! " [ -f #{repo_path}/HEAD ] " end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/capistrano/git/push_strategy.rb', line 25 def update host = context.host run_locally do execute :git, :push, '--force', "#{host.user}@#{host.hostname}:#{repo_path} #{fetch(:branch)}:master" end end |