Sha256: b0177e7dc9b4a18f0d7d93e39e3a9b646873c2513c70f7291d8e7d8bf7a0f04a

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

#!/usr/bin/env ruby

require "./lib/kommando"
require "yaml"

docker_compose=YAML.load(File.read("docker-compose.yml"))
services = docker_compose["services"].keys

Kommando.run("docker-compose build", {
  output: true
}).when(:failed) {
  raise "build failed"
}

ks = []
for service in services
  k = Kommando.new "docker-compose up #{service}"
  k.run_async
  ks << k
end

loop do
  for k in ks do
    cmd=k.instance_variable_get(:@cmd)
    puts "#{cmd} (#{(k.code ? "STOP" : "RUNNING")})"

    if k.code
      puts k.out
      exit 1
    end
  end

  print "-"*20; puts " #{DateTime.now.to_s}"
  sleep 2
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kommando-0.1.0 bin/matrix