Class: Capistrano::Rsync::Scm::Git
- Inherits:
-
Base
- Object
- Base
- Capistrano::Rsync::Scm::Git
show all
- Defined in:
- lib/capistrano/rsync/scm/git.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
6
7
8
|
# File 'lib/capistrano/rsync/scm/git.rb', line 6
def context
@context
end
|
Instance Method Details
#create_stage_cmds ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/capistrano/rsync/scm/git.rb', line 12
def create_stage_cmds
cmd = []
clone = %W[git clone]
clone << context.fetch(:repo_url, ".")
clone << context.fetch(:rsync_stage)
cmd << clone
cmd
end
|
#get_current_revision_cmd ⇒ Object
8
9
10
|
# File 'lib/capistrano/rsync/scm/git.rb', line 8
def get_current_revision_cmd
"git rev-parse HEAD"
end
|
#update_stage_cmds ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/capistrano/rsync/scm/git.rb', line 21
def update_stage_cmds
cmd = []
update = %W[git fetch --quiet --all --prune]
cmd << update
checkout = %W[git reset --hard origin/#{fetch(:branch)}]
cmd << checkout
cmd
end
|