Class: Capistrano::SCM::LocalGitUpload

Inherits:
Plugin
  • Object
show all
Defined in:
lib/capistrano/scm/local_git_upload.rb

Overview

Capistrano SCM plugin for local git clone followed by upload

Instance Method Summary collapse

Constructor Details

#initializeLocalGitUpload

Returns a new instance of LocalGitUpload.



27
28
29
30
# File 'lib/capistrano/scm/local_git_upload.rb', line 27

def initialize
  super
  @git_plugin = Capistrano::SCM::Git.new
end

Instance Method Details

#define_tasksObject



40
41
42
43
# File 'lib/capistrano/scm/local_git_upload.rb', line 40

def define_tasks
  eval_rakefile File.expand_path('tasks/git_local.rake', __dir__)
  eval_rakefile File.expand_path('tasks/upload.rake', __dir__)
end

#register_hooksObject



45
46
47
48
49
50
51
52
# File 'lib/capistrano/scm/local_git_upload.rb', line 45

def register_hooks
  before 'deploy:check', 'upload:check_directory'
  before 'deploy:started', 'git_local:create_work'
  after 'deploy:new_release_path', 'upload:create_release'
  before 'deploy:set_current_revision', 'git_local:set_current_revision'
  after 'deploy:finishing', 'git_local:remove_directory'
  after 'deploy:finishing', 'upload:remove_directory'
end

#set_defaultsObject



32
33
34
35
36
37
38
# File 'lib/capistrano/scm/local_git_upload.rb', line 32

def set_defaults
  @git_plugin.set_defaults
  set_if_empty :local_top, Dir.getwd
  set_if_empty :repo_path, local_path('repo')
  set_if_empty :work_path, local_path('work')
  set_if_empty :upload_path, local_path('upload')
end