Sha256: bfff57eb05ded8b04dd45f81bcecc677f92be11c1b0140f4b8d00a2324c4a36b

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

require "docktor/yaml_parser"
require "docktor/docker_client"

module Docktor
  class Runner
    DEFAULT_YAML_PATH = "./docktor.yml"

    def invoke(yaml_path: DEFAULT_YAML_PATH, parser: Docktor::YAMLParser.new, client: Docktor::DockerClient.new)
      containers = parser.parse(yaml_path)

      containers.each do |container|
        if client.container_exists?(container)
          client.start container
        else
          client.run container
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
docktor-0.1.0 lib/docktor/runner.rb