Class: Capistrano::Distribution::Distributor::CurlTar

Inherits:
AbstractCurl show all
Includes:
TarHelper
Defined in:
lib/capistrano/distribution/distributor/curl_tar.rb

Overview

Deploys Tar files downloadable using the curl command.

Constant Summary

Constants inherited from AbstractArchiver

AbstractArchiver::EXT_MATCHER

Instance Attribute Summary

Attributes inherited from AbstractArchiver

#subtree

Attributes inherited from Abstract

#context, #repo_id, #target, #url

Instance Method Summary collapse

Methods included from TarHelper

#compression_opt, #strip_components_opt

Methods inherited from AbstractCurl

#check

Methods inherited from AbstractArchiver

#check, #ext_matcher, #initialize

Methods inherited from Abstract

#check, #initialize, #release_path, #repo_path

Constructor Details

This class inherits a constructor from Capistrano::Distribution::Distributor::AbstractArchiver

Instance Method Details

#distributenil

Extracts the content rooted under AbstractArchiver#subtree within the Tar file indicated by Abstract#url to the location indicated by Abstract#release_path. The Tar file is extracted as it is downloaded, so no local copy of the Tar file itself is ever created.

Returns:

  • (nil)

See Also:

  • Archiver#distribute


22
23
24
25
26
27
28
29
30
31
# File 'lib/capistrano/distribution/distributor/curl_tar.rb', line 22

def distribute
  context.execute 'mkdir', '-p', release_path
  context.execute 'curl', '--fail', '--location', '--silent', url, '|',
                  'tar', '-x',
                  compression_opt,
                  strip_components_opt,
                  '-C', release_path,
                  subtree
  nil
end