Module: Capistrano::Git::DefaultStrategy
- Defined in:
- lib/capistrano/git.rb
Overview
The Capistrano default strategy for git. You should want to use this.
Instance Method Summary collapse
- #check ⇒ Object
- #clone ⇒ Object
- #fetch_revision ⇒ Object
- #release ⇒ Object
- #test ⇒ Object
- #update ⇒ Object
Instance Method Details
#check ⇒ Object
20 21 22 |
# File 'lib/capistrano/git.rb', line 20 def check git :'ls-remote --heads', repo_url end |
#clone ⇒ Object
24 25 26 |
# File 'lib/capistrano/git.rb', line 24 def clone git :clone, '--mirror', repo_url, repo_path end |
#fetch_revision ⇒ Object
42 43 44 |
# File 'lib/capistrano/git.rb', line 42 def fetch_revision context.capture(:git, "rev-parse --short #{fetch(:branch)}") end |
#release ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/capistrano/git.rb', line 32 def release if tree = fetch(:repo_tree) tree = tree.slice %r#^/?(.*?)/?$#, 1 components = tree.split('/').size git :archive, fetch(:branch), tree, "| tar -x --strip-components #{components} -f - -C", release_path else git :archive, fetch(:branch), '| tar -x -f - -C', release_path end end |
#test ⇒ Object
16 17 18 |
# File 'lib/capistrano/git.rb', line 16 def test test! " [ -f #{repo_path}/HEAD ] " end |
#update ⇒ Object
28 29 30 |
# File 'lib/capistrano/git.rb', line 28 def update git :remote, :update end |