Compare commits
No commits in common. "6b15ee068431ecb12e5c10f6fa78d3bb08abd28c" and "b3dec4b138e111fdcbf8b5b98470c40f63954924" have entirely different histories.
6b15ee0684
...
b3dec4b138
2 changed files with 3 additions and 18 deletions
6
Makefile
6
Makefile
|
@ -1,6 +0,0 @@
|
|||
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
shards build
|
15
src/main.cr
15
src/main.cr
|
@ -55,17 +55,15 @@ puts "docker_image = #{docker_image}"
|
|||
puts "action = #{action}"
|
||||
|
||||
docker_name = "docmachine-#{basehash}"
|
||||
docker_cid = %x{docker ps -f "name=#{docker_name}" -q}.strip
|
||||
docker_cid = %x{docker ps -f "name=#{docker_name} -q)}.strip
|
||||
uid = %x{id -u}.strip
|
||||
gid = %x{id -g}.strip
|
||||
puts "uid: #{uid}"
|
||||
puts "cid: #{gid}"
|
||||
|
||||
puts "docker_name: #{docker_name}"
|
||||
puts "docker_cid: #{docker_cid}"
|
||||
|
||||
if !docker_cid.empty?
|
||||
Process.run("docker", ["kill", docker_name])
|
||||
Process.run("docker", ["kill", docker_cid])
|
||||
end
|
||||
|
||||
docker_opts << "run"
|
||||
|
@ -129,12 +127,5 @@ docker_opts << docker_image
|
|||
docker_opts << action
|
||||
|
||||
puts docker_opts.inspect.colorize(:yellow)
|
||||
process = Process.new("docker", docker_opts, output: STDOUT, error: STDERR)
|
||||
|
||||
Signal::INT.trap do
|
||||
STDERR.puts "Received CTRL-C"
|
||||
process.signal(Signal::KILL)
|
||||
Process.run("docker", ["kill", docker_name])
|
||||
end
|
||||
process.wait
|
||||
process = Process.run("docker", docker_opts, output: STDOUT, error: STDERR)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue