Sha256: 951abb8bffcc12efc0588d50f7de024020a6709c5d36e418c6de9b84c05a9fff

Contents?: true

Size: 1.76 KB

Versions: 4

Compression:

Stored size: 1.76 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

4 entries across 4 versions & 1 rubygems

Version Path
depengine-3.0.3 lib/depengine/dsl/dweb.rb
depengine-3.0.2 lib/depengine/dsl/dweb.rb
depengine-3.0.1 lib/depengine/dsl/dweb.rb
depengine-3.0.0 lib/depengine/dsl/dweb.rb