Class: Capistrano::SCM Abstract
- Inherits:
-
Object
- Object
- Capistrano::SCM
- Defined in:
- lib/capistrano/scm.rb
Overview
Base class for SCM strategy providers.
Defined Under Namespace
Instance Attribute Summary collapse
-
#context ⇒ Rake
readonly
The current value of context.
Instance Method Summary collapse
-
#check ⇒ Boolean
abstract
Your implementation should check if the specified remote-repository is available.
-
#clone ⇒ Object
abstract
Create a (new) clone of the remote-repository on the deployment target.
-
#fetch(*args) ⇒ Object
Fetch a var from the context.
-
#fetch_revision ⇒ Object
abstract
Identify the SHA of the commit that will be deployed.
-
#initialize(context, strategy) ⇒ SCM
constructor
Provide a wrapper for the SCM that loads a strategy for the user.
-
#release ⇒ Object
abstract
Copy the contents of the cache-repository onto the release path.
-
#release_path ⇒ Object
The release path according to the context.
-
#repo_path ⇒ Object
The repository path according to the context.
-
#repo_url ⇒ Object
The repository URL according to the context.
-
#test ⇒ Boolean
abstract
Your implementation should check the existence of a cache repository on the deployment target.
-
#test!(*args) ⇒ Object
Call test in context.
-
#update ⇒ Object
abstract
Update the clone on the deployment target.
Constructor Details
#initialize(context, strategy) ⇒ SCM
Provide a wrapper for the SCM that loads a strategy for the user.
19 20 21 22 23 |
# File 'lib/capistrano/scm.rb', line 19 def initialize(context, strategy) @context = context singleton = class << self; self; end singleton.send(:include, strategy) end |
Instance Attribute Details
#context ⇒ Rake (readonly)
Returns the current value of context.
10 11 12 |
# File 'lib/capistrano/scm.rb', line 10 def context @context end |
Instance Method Details
#check ⇒ Boolean
Your implementation should check if the specified remote-repository is available.
71 72 73 |
# File 'lib/capistrano/scm.rb', line 71 def check raise NotImplementedError, "Your SCM strategy module should provide a #check method" end |
#clone ⇒ Object
Create a (new) clone of the remote-repository on the deployment target
81 82 83 |
# File 'lib/capistrano/scm.rb', line 81 def clone raise NotImplementedError, "Your SCM strategy module should provide a #clone method" end |
#fetch(*args) ⇒ Object
Fetch a var from the context
49 50 51 |
# File 'lib/capistrano/scm.rb', line 49 def fetch(*args) context.fetch(*args) end |
#fetch_revision ⇒ Object
Identify the SHA of the commit that will be deployed. This will most likely involve SshKit’s capture method.
111 112 113 |
# File 'lib/capistrano/scm.rb', line 111 def fetch_revision raise NotImplementedError, "Your SCM strategy module should provide a #fetch_revision method" end |
#release ⇒ Object
Copy the contents of the cache-repository onto the release path
101 102 103 |
# File 'lib/capistrano/scm.rb', line 101 def release raise NotImplementedError, "Your SCM strategy module should provide a #release method" end |
#release_path ⇒ Object
The release path according to the context
41 42 43 |
# File 'lib/capistrano/scm.rb', line 41 def release_path context.release_path end |
#repo_path ⇒ Object
The repository path according to the context
36 37 38 |
# File 'lib/capistrano/scm.rb', line 36 def repo_path context.repo_path end |
#repo_url ⇒ Object
The repository URL according to the context
31 32 33 |
# File 'lib/capistrano/scm.rb', line 31 def repo_url context.repo_url end |
#test ⇒ Boolean
Your implementation should check the existence of a cache repository on the deployment target
60 61 62 |
# File 'lib/capistrano/scm.rb', line 60 def test raise NotImplementedError, "Your SCM strategy module should provide a #test method" end |
#test!(*args) ⇒ Object
Call test in context
26 27 28 |
# File 'lib/capistrano/scm.rb', line 26 def test!(*args) context.test(*args) end |
#update ⇒ Object
Update the clone on the deployment target
91 92 93 |
# File 'lib/capistrano/scm.rb', line 91 def update raise NotImplementedError, "Your SCM strategy module should provide a #update method" end |