Sha256: c34273374ed5418e60170ac9dbdd8d4f8882e9390326cc2381c4897237dc5c27

Contents?: true

Size: 700 Bytes

Versions: 11

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true
module NoradCli
  class ResultsServer
    attr_accessor :container

    def initialize(test_results_server_image)
      @container = Docker::Container.create(
        Image: test_results_server_image,
        HostConfig: { PublishAllPorts: true }
      )
    end

    def start
      @container.start
      sleep 5 # sleep rather than wait since we are daemonizing a containe
      refresh
    end

    def refresh
      @container.refresh! # get more details
    end

    def shutdown
      @container.stop
      @container.delete(force: true)
    end

    def host_port
      @container.info['NetworkSettings']['Ports']['3000/tcp'].first['HostPort']
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
norad_cli-0.1.23 lib/norad_cli/support/results_server.rb
norad_cli-0.1.22 lib/norad_cli/support/results_server.rb
norad_cli-0.1.21 lib/norad_cli/support/results_server.rb
norad_cli-0.1.20 lib/norad_cli/support/results_server.rb
norad_cli-0.1.19 lib/norad_cli/support/results_server.rb
norad_cli-0.1.18 lib/norad_cli/support/results_server.rb
norad_cli-0.1.17 lib/norad_cli/support/results_server.rb
norad_cli-0.1.16 lib/norad_cli/support/results_server.rb
norad_cli-0.1.15 lib/norad_cli/support/results_server.rb
norad_cli-0.1.14 lib/norad_cli/support/results_server.rb
norad_cli-0.1.13 lib/norad_cli/support/results_server.rb