Class Nanoc3::Extra::Deployers::Rsync
In: lib/nanoc3/extra/deployers/rsync.rb
Parent: Object

A deployer that deploys a site using rsync.

Methods

new   run  

Constants

DEFAULT_OPTIONS = [ '-glpPrtvz', '--exclude=".hg"', '--exclude=".svn"', '--exclude=".git"'   Default rsync options

Public Class methods

Creates a new deployer that uses rsync. The deployment configurations will be read from the configuration file of the site (which is assumed to be the current working directory).

The deployment configurations are stored like this in the site‘s configuration file:

  deploy:
    NAME:
      options: [ OPTIONS ]
      dst:     "DST"

`NAME` is a unique name for the deployment configuration. By default, the deployer will use the deployment configuration named `"default"`.

`OPTIONS` is an array containing options to pass to the rsync executable. This is not required; by default, {DEFAULT_OPTIONS} options will be used.

`DST` is a string containing the destination to where rsync should upload its data. It will likely be in `host:path` format. For example, `"example.com:/var/www/sites/mysite/html"`. It should not end with a trailing slash.

Example: This deployment configuration defines a "default" and a "staging" deployment configuration. The default options are used.

  deploy:
    default:
      dst: "ectype:sites/stoneship/public"
    staging:
      dst: "ectype:sites/stoneship-staging/public"
      options: [ "-glpPrtvz" ]

When running the deployer with the `default` resp. `staging` configurations, the following rsync commands will be executed:

  rsync -glpPrtvz --exclude=".hg" --exclude=".svn"
    --exclude=".git" output ectype:sites/stoneship/public

  rsync -glpPrtvz output ectype:sites/stoneship-staging/public

Public Instance methods

Runs the task. Possible params:

@option params [Boolean] :dry_run (false) True if the action itself should not be executed, but still printed; false otherwise.

@option params [String] :config_name (:default) The name of the deployment configuration to use.

@return [void]

[Validate]