Class: Nanoc::Extra::Deployers::Rsync
- Inherits:
-
Nanoc::Extra::Deployer
- Object
- Nanoc::Extra::Deployer
- Nanoc::Extra::Deployers::Rsync
- Defined in:
- lib/nanoc/extra/deployers/rsync.rb
Overview
A deployer that deploys a site using rsync.
The configuration has should include a :dst
value, a string containing
the destination to where rsync should upload its data. It will likely be
in host:path
format. It should not end with a slash. For example,
"example.com:/var/www/sites/mysite/html"
.
Constant Summary
- DEFAULT_OPTIONS =
Default rsync options
[ '-glpPrtvz', '--exclude=".hg"', '--exclude=".svn"', '--exclude=".git"' ]
Instance Attribute Summary
Attributes inherited from Nanoc::Extra::Deployer
#config, #dry_run, #source_path
Instance Method Summary (collapse)
Methods inherited from Nanoc::Extra::Deployer
Methods included from PluginRegistry::PluginMethods
#all, #identifier, #identifiers, #named, #register
Constructor Details
This class inherits a constructor from Nanoc::Extra::Deployer
Instance Method Details
- (Object) run
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/nanoc/extra/deployers/rsync.rb', line 33 def run # Get params src = source_path + '/' dst = config[:dst] = config[:options] || DEFAULT_OPTIONS # Validate raise 'No dst found in deployment configuration' if dst.nil? raise 'dst requires no trailing slash' if dst[-1, 1] == '/' # Run if dry_run warn 'Performing a dry-run; no actions will actually be performed' run_shell_cmd([ 'echo', 'rsync', , src, dst ].flatten) else run_shell_cmd([ 'rsync', , src, dst ].flatten) end end |