Sha256: 2d9bf83f8e89fbee9a9f25a100332b1e8e8d0ea80dc8e47ea0415061b0f58820

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 KB

Contents

require 'rundock/operation/base'

module Rundock
  module Operation
    # You can use this as following scenario.yml for example.
    #
    # - node: localhost
    #  deploy:
    #    - src: /tmp/deploy_from_local_file
    #      dst: /tmp/deploy_dest_local_file
    #    - src: /tmp/deploy_from_local_dir
    #      dst: /tmp/deploy_dest_local_dir
    # - node: anyhost-01
    #  deploy:
    #    - src: /tmp/deploy_from_local_file
    #      dst: /tmp/deploy_dest_remote_file
    #    - src: /tmp/deploy_from_local_dir
    #      dst: /tmp/deploy_dest_remote_dir
    # ---
    # anyhost-01:
    #   host: 192.168.1.11
    #   ssh_opts:
    #     port: 22
    #     user: anyuser
    #     key:  ~/.ssh/id_rsa
    # ---
    class Deploy < Base
      def run(backend, attributes)
        options = attributes[:deploy]

        options.each do |path|
          Logger.error('src: options not found.') if !path[:src] || path[:src].blank?
          Logger.error('dst: options not found.') if !path[:dst] || path[:dst].blank?
          Logger.info("deploy localhost:#{path[:src]} remote:#{attributes[:nodeinfo][:host]}:#{path[:dst]}")
          backend.send_file(path[:src], path[:dst])
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rundock-0.5.0 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.16 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.15 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.14 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.13 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.12 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.11 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.10 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.8 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.7 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.6 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.4 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.3 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.2 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.1 lib/rundock/plugin/operation/deploy.rb
rundock-0.4.0 lib/rundock/plugin/operation/deploy.rb
rundock-0.3.0 lib/rundock/plugin/operation/deploy.rb