class Capistrano::SCM
Base class for SCM strategy providers.
@abstract
@attr_reader [Rake] context
@author Hartog de Mik
Attributes
Public Class Methods
Provide a wrapper for the SCM that loads a strategy for the user.
@param [Rake] context The context in which the strategy should run @param [Module] strategy A module to include into the SCM instance. The
module should provide the abstract methods of Capistrano::SCM
# File lib/capistrano/scm.rb, line 19 def initialize(context, strategy) @context = context singleton = class << self; self; end singleton.send(:include, strategy) end
Public Instance Methods
@abstract
Your implementation should check if the specified remote-repository is available.
@return [Boolean]
# File lib/capistrano/scm.rb, line 71 def check raise NotImplementedError, "Your SCM strategy module should provide a #check method" end
@abstract
Create a (new) clone of the remote-repository on the deployment target
@return void
# File lib/capistrano/scm.rb, line 81 def clone raise NotImplementedError, "Your SCM strategy module should provide a #clone method" end
Fetch a var from the context @param [Symbol] variable The variable to fetch @param [Object] default The default value if not found
# File lib/capistrano/scm.rb, line 49 def fetch(*args) context.fetch(*args) end
@abstract
Identify the SHA of the commit that will be deployed. This will most likely involve SshKit's capture method.
@return void
# File lib/capistrano/scm.rb, line 111 def fetch_revision raise NotImplementedError, "Your SCM strategy module should provide a #fetch_revision method" end
@abstract
Copy the contents of the cache-repository onto the release path
@return void
# File lib/capistrano/scm.rb, line 101 def release raise NotImplementedError, "Your SCM strategy module should provide a #release method" end
The release path according to the context
# File lib/capistrano/scm.rb, line 41 def release_path context.release_path end
The repository path according to the context
# File lib/capistrano/scm.rb, line 36 def repo_path context.repo_path end
The repository URL according to the context
# File lib/capistrano/scm.rb, line 31 def repo_url context.repo_url end
@abstract
Your implementation should check the existence of a cache repository on the deployment target
@return [Boolean]
# File lib/capistrano/scm.rb, line 60 def test raise NotImplementedError, "Your SCM strategy module should provide a #test method" end
Call test in context
# File lib/capistrano/scm.rb, line 26 def test!(*args) context.test(*args) end
@abstract
Update the clone on the deployment target
@return void
# File lib/capistrano/scm.rb, line 91 def update raise NotImplementedError, "Your SCM strategy module should provide a #update method" end