Class: Capistrano::Scm::None::Plugin

Inherits:
Capistrano::SCM::Plugin
  • Object
show all
Defined in:
lib/capistrano/scm/none.rb

Instance Method Summary collapse

Instance Method Details

#define_tasksObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/capistrano/scm/none.rb', line 11

def define_tasks
  namespace :scm do
    namespace :none do
      task :create_release do
        on release_roles :all do
          execute :mkdir, "-p", release_path
        end
        if Rake::Task.task_defined?('deploy:upload')
          invoke('deploy:upload')
        else
          raise "Expecting a deploy:upload task to be defined."
        end
      end

      task :set_current_revision do
        # TODO something better here
        #sh :git, "rev-list --max-count=1 branch"
        set :current_revision, "do to grab current git revision"
      end
    end
  end
end

#register_hooksObject



34
35
36
37
# File 'lib/capistrano/scm/none.rb', line 34

def register_hooks
  after "deploy:new_release_path", "scm:none:create_release"
  before "deploy:set_current_revision", "scm:none:set_current_revision"
end

#set_defaultsObject



8
9
# File 'lib/capistrano/scm/none.rb', line 8

def set_defaults
end