Class: Capistrano::Patch::Strategy::GitServer

Inherits:
Git
  • Object
show all
Defined in:
lib/capistrano/patch/strategy/git_server.rb

Instance Attribute Summary

Attributes inherited from Base

#revision_from, #revision_to

Instance Method Summary collapse

Methods inherited from Git

#apply, #check_apply, #check_revert, #patch_directory, #patch_repository, #revert

Methods inherited from Base

#apply, #check_apply, #check_revert, #initialize, #mark_apply, #mark_revert, #patch_directory, #patch_file, #patch_path, #revert

Constructor Details

This class inherits a constructor from Capistrano::Patch::Strategy::Base

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
# File 'lib/capistrano/patch/strategy/git_server.rb', line 12

def create
  command = "mkdir -p #{patch_directory} && "
  command << source.scm('diff-tree', "--binary #{revision_from}..#{revision_to} > #{patch_path}")

  run(command, {
    :hosts => [server],
    :env => { 'GIT_DIR' => patch_repository }
  })
end

#deliverObject



22
23
24
25
26
# File 'lib/capistrano/patch/strategy/git_server.rb', line 22

def deliver
  command = "cd #{current_path} && "
  command << "wget -N -q #{patch_location}"
  run(command)
end

#patch_locationObject



8
9
10
# File 'lib/capistrano/patch/strategy/git_server.rb', line 8

def patch_location
  File.join configuration.fetch(:patch_base_url), patch_file
end