Module: Deployment::Methods::DWEB

Defined in:
lib/depengine/dsl/dweb.rb

Instance Method Summary collapse

Instance Method Details



35
36
37
38
39
40
41
42
# File 'lib/depengine/dsl/dweb.rb', line 35

def dweb_link(source, symlink, options = {})
  publisher = ::Publisher::Dweb.new
  publisher.staging_host = @cdb['staging_host']
  publisher.ssh_key_file = @cdb['ssh_key_file']
  publisher.siteid       = @cdb['siteid']

  publisher.remote_symlink(source, symlink, options)
end

#dweb_upload(source, target, options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/depengine/dsl/dweb.rb', line 16

def dweb_upload(source, target, options = {})
  Helper.validates_presence_of @cdb['staging_host'], 'Staging Host not set'
  Helper.validates_presence_of @cdb['ssh_key_file'], 'SSH keyfile not set'
  Helper.validates_presence_of @cdb['siteid'], 'Siteid not set'
  Helper.validates_presence_of source
  Helper.validates_presence_of target

  publisher = ::Publisher::Dweb.new
  publisher.staging_host = @cdb['staging_host']
  publisher.ssh_key_file = @cdb['ssh_key_file']
  publisher.siteid       = @cdb['siteid']

  vhost                  = options[:siteid]   || @cdb['siteid']
  options[:excludes]     = options[:excludes] || ['.svn']

  publisher.upload(File.join($recipe_config[:deploy_home], source), \
                   File.join('/vhosts/', vhost, target), options)
end

#send_dweb_command(command, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/depengine/dsl/dweb.rb', line 4

def send_dweb_command(command, options = {})
  Helper.validates_presence_of @cdb['staging_host'], 'Staging Host not set'
  Helper.validates_presence_of @cdb['ssh_key_file_command'], 'SSH keyfile not set'
  Helper.validates_presence_of @cdb['siteid'], 'Siteid not set'

  publisher = ::Publisher::Dweb.new
  publisher.staging_host = @cdb['staging_host']
  publisher.ssh_key_file = @cdb['ssh_key_file_command']
  publisher.siteid       = @cdb['siteid']
  publisher.send_command(command, options)
end