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.47 lib/docman/commands/ssh_target_checker.rb
docman-0.0.46 lib/docman/commands/ssh_target_checker.rb
docman-0.0.45 lib/docman/commands/ssh_target_checker.rb
docman-0.0.44 lib/docman/commands/ssh_target_checker.rb
docman-0.0.43 lib/docman/commands/ssh_target_checker.rb
docman-0.0.42 lib/docman/commands/ssh_target_checker.rb
docman-0.0.41 lib/docman/commands/ssh_target_checker.rb
docman-0.0.40 lib/docman/commands/ssh_target_checker.rb
docman-0.0.39 lib/docman/commands/ssh_target_checker.rb
docman-0.0.38 lib/docman/commands/ssh_target_checker.rb
docman-0.0.37 lib/docman/commands/ssh_target_checker.rb
docman-0.0.36 lib/docman/commands/ssh_target_checker.rb
docman-0.0.35 lib/docman/commands/ssh_target_checker.rb
docman-0.0.34 lib/docman/commands/ssh_target_checker.rb
docman-0.0.33 lib/docman/commands/ssh_target_checker.rb
docman-0.0.32 lib/docman/commands/ssh_target_checker.rb
docman-0.0.31 lib/docman/commands/ssh_target_checker.rb
docman-0.0.30 lib/docman/commands/ssh_target_checker.rb
docman-0.0.29 lib/docman/commands/ssh_target_checker.rb
docman-0.0.28 lib/docman/commands/ssh_target_checker.rb