Sha256: 40e9503466454076eac73d2da4c3c1a8d272d15158359819f33863728309db5b

Contents?: true

Size: 675 Bytes

Versions: 93

Compression:

Stored size: 675 Bytes

Contents

require 'net/sftp'

module Docman

  class SSHTargetChecker < Docman::TargetChecker

    register_checker :ssh

    def execute
      filename = File.join(self['file_path'], self['filename'])
      Net::SFTP.start(self['ssh_host'], self['ssh_user']) do |sftp|
        n = 0
        begin
          sleep 15
          n+=1
          log "Checking if files deployed, retry ##{n}, filename: #{filename}"
          sftp.stat!(filename) do |response|
            unless response.ok?
              sleep 15
            end
          end
          data = YAML.load sftp.download!(filename)
        end until data['random'] == self['version']
      end
      true
    end

  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
docman-0.0.107 lib/docman/commands/ssh_target_checker.rb
docman-0.0.106 lib/docman/commands/ssh_target_checker.rb
docman-0.0.105 lib/docman/commands/ssh_target_checker.rb
docman-0.0.104 lib/docman/commands/ssh_target_checker.rb
docman-0.0.103 lib/docman/commands/ssh_target_checker.rb
docman-0.0.102 lib/docman/commands/ssh_target_checker.rb
docman-0.0.101 lib/docman/commands/ssh_target_checker.rb
docman-0.0.100 lib/docman/commands/ssh_target_checker.rb
docman-0.0.99 lib/docman/commands/ssh_target_checker.rb
docman-0.0.98 lib/docman/commands/ssh_target_checker.rb
docman-0.0.97 lib/docman/commands/ssh_target_checker.rb
docman-0.0.96 lib/docman/commands/ssh_target_checker.rb
docman-0.0.95 lib/docman/commands/ssh_target_checker.rb
docman-0.0.94 lib/docman/commands/ssh_target_checker.rb
docman-0.0.93 lib/docman/commands/ssh_target_checker.rb
docman-0.0.92 lib/docman/commands/ssh_target_checker.rb
docman-0.0.91 lib/docman/commands/ssh_target_checker.rb
docman-0.0.90 lib/docman/commands/ssh_target_checker.rb
docman-0.0.89 lib/docman/commands/ssh_target_checker.rb
docman-0.0.88 lib/docman/commands/ssh_target_checker.rb