Class: Deployer::ConfigDeployer

Inherits:
BaseDeployer show all
Defined in:
lib/deployer/config_deployer.rb

Instance Attribute Summary

Attributes inherited from BaseDeployer

#options, #stage, #stage_path

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ConfigDeployer

Returns a new instance of ConfigDeployer.



2
3
4
5
# File 'lib/deployer/config_deployer.rb', line 2

def initialize(options = {})
  options[:deploy_via] = 'svn'
  super(options)
end

Instance Method Details

#deploy!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/deployer/config_deployer.rb', line 7

def deploy!
  puts "deploying to #{stage.name} via #{deploy_via}".light_blue.on_blue
  Deployer::Executor.new(stage, verbose: verbose?) do |executor|
    create_base_dirs(executor)
    update_scm(executor)

    source = cached_copy_dir('..', 'config', "%{stagename}", "%{hostname}", '')
    target = config_source_dir

    cmd = "rsync -r --exclude=.svn #{source} #{target}"
    executor.execute(cmd)
  end
end