lib/ufo/docker/builder.rb in ufo-1.6.0 vs lib/ufo/docker/builder.rb in ufo-1.6.1
- old
+ new
@@ -28,11 +28,11 @@
say " #{command}".green
check_dockerfile_exists
command = "cd #{@project_root} && #{command}"
success = execute(command, use_system: true)
unless success
- puts "The docker image fail to build. Are you sure the docker daemon is available? Try running: docker version"
+ puts "ERROR: The docker image fail to build. Are you sure the docker daemon is available? Try running: docker version".colorize(:red)
exit 1
end
took = Time.now - start_time
say "Docker image #{full_image_name} built. " + "Took #{pretty_time(took)}.".green
@@ -43,10 +43,16 @@
start_time = Time.now
message = "Pushed #{full_image_name} docker image."
if @options[:noop]
message = "NOOP #{message}"
else
- execute("docker push #{full_image_name}", use_system: true)
+ command = "docker push #{full_image_name}"
+ puts "=> #{command}".colorize(:green)
+ success = execute(command, use_system: true)
+ unless success
+ puts "ERROR: The docker image fail to push.".colorize(:red)
+ exit 1
+ end
end
took = Time.now - start_time
message << " Took #{pretty_time(took)}.".green
puts message unless @options[:mute]
end