Sha256: a24337188d0ca7e98c1eed47aa556d3864ba4ffa15ba01109c94c5c7002fe888

Contents?: true

Size: 1.77 KB

Versions: 3

Compression:

Stored size: 1.77 KB

Contents

module Deployment
  module Methods
    module DWEB
      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

      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

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
depengine-3.0.23 lib/depengine/dsl/dweb.rb
depengine-3.0.22 lib/depengine/dsl/dweb.rb
depengine-3.0.21 lib/depengine/dsl/dweb.rb