lib/command/build_image.rb in cpl-1.4.0 vs lib/command/build_image.rb in cpl-2.2.0

- old
+ new

@@ -25,29 +25,24 @@ raise "Can't find Dockerfile at '#{dockerfile}'." unless File.exist?(dockerfile) progress.puts("Building image from Dockerfile '#{dockerfile}'...\n\n") - image_name = latest_image_next + image_name = cp.latest_image_next image_url = "#{config.org}.registry.cpln.io/#{image_name}" commit = config.options[:commit] build_args = [] build_args.push("GIT_COMMIT=#{commit}") if commit cp.image_build(image_url, dockerfile: dockerfile, docker_args: config.args, build_args: build_args) - progress.puts("\nPushed image to '/org/#{config.org}/image/#{image_name}'.") - end + progress.puts("\nPushed image to '/org/#{config.org}/image/#{image_name}'.\n\n") - private - - def ensure_docker_running! - `docker version > /dev/null 2>&1` - return if $CHILD_STATUS.success? - - raise "Can't run Docker. Please make sure that it's installed and started, then try again." + step("Waiting for image to be available", retry_on_failure: true) do + image_name == cp.latest_image(refresh: true) + end end end end