Class: Capistrano::BundleRsync::SCM Abstract
- Defined in:
- lib/capistrano/bundle_rsync/scm.rb
Overview
Base class for SCM strategy providers.
Instance Method Summary collapse
-
#check ⇒ Boolean
abstract
Your implementation should check if the specified remote-repository is available.
-
#clean_release ⇒ Object
abstract
Clean the contents of the cache-repository onto the release path.
-
#clone ⇒ Object
abstract
Create a (new) clone of the remote-repository on the deployment target.
-
#create_release ⇒ Object
abstract
Copy the contents of the cache-repository onto the release path.
-
#rsync_release ⇒ Object
abstract
Rsync the contents of the release path.
-
#rsync_shared ⇒ Object
abstract
Rsync arbitrary contents to shared directory.
-
#set_current_revision ⇒ Object
abstract
Identify the SHA of the commit that will be deployed.
-
#update ⇒ Object
abstract
Update the clone on the deployment target.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Capistrano::BundleRsync::Base
Instance Method Details
#check ⇒ Boolean
Your implementation should check if the specified remote-repository is available.
15 16 17 18 19 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 15 def check raise NotImplementedError.new( "Your SCM strategy module should provide a #check method" ) end |
#clean_release ⇒ Object
Clean the contents of the cache-repository onto the release path
63 64 65 66 67 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 63 def clean_release raise NotImplementedError.new( "Your SCM strategy module should provide a #clean_release method" ) end |
#clone ⇒ Object
Create a (new) clone of the remote-repository on the deployment target
27 28 29 30 31 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 27 def clone raise NotImplementedError.new( "Your SCM strategy module should provide a #clone method" ) end |
#create_release ⇒ Object
Copy the contents of the cache-repository onto the release path
51 52 53 54 55 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 51 def create_release raise NotImplementedError.new( "Your SCM strategy module should provide a #create_release method" ) end |
#rsync_release ⇒ Object
Rsync the contents of the release path
This is an additional task endpoint provided by capistrano-bundle_rsync
77 78 79 80 81 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 77 def rsync_release raise NotImplementedError.new( "Your SCM strategy module should provide a #rsync_release method" ) end |
#rsync_shared ⇒ Object
Rsync arbitrary contents to shared directory
This is an additional task endpoint provided by capistrano-bundle_rsync
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 90 def rsync_shared hosts = ::Capistrano::Configuration.env.filter(release_roles(:all)) = config. if config_files = config.config_files Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host| ssh = config.build_ssh_command(host) execute :rsync, , "--rsh='#{ssh}'", *config_files.map(&:to_s), "#{host}:#{config.release_app_path}/config/" end end if shared_dirs = config.shared_dirs Parallel.each(hosts, in_threads: config.max_parallels(hosts)) do |host| ssh = config.build_ssh_command(host) shared_dirs_without_suffix = shared_dirs.map { |dir| dir.to_s.delete_suffix('/') } execute :rsync, , "--rsh='#{ssh}'", *shared_dirs_without_suffix, "#{host}:#{shared_path}/" end end end |
#set_current_revision ⇒ Object
Identify the SHA of the commit that will be deployed. This will most likely involve SshKit’s capture method.
116 117 118 119 120 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 116 def set_current_revision raise NotImplementedError.new( "Your SCM strategy module should provide a #set_current_revision method" ) end |
#update ⇒ Object
Update the clone on the deployment target
39 40 41 42 43 |
# File 'lib/capistrano/bundle_rsync/scm.rb', line 39 def update raise NotImplementedError.new( "Your SCM strategy module should provide a #update method" ) end |