Sha256: d35e20f81d96501127e006d20a571325b56ad1c7f9bdaff5bf6ad7cbbf2230c2
Contents?: true
Size: 1.1 KB
Versions: 22
Compression:
Stored size: 1.1 KB
Contents
module Ufo::Docker class Pusher include Concerns delegate :docker_image, to: :builder attr_reader :last_image_name def initialize(image, options) @options = options # docker_image ultimately uses @options, so @last_image_name assignment # line must be defined after setting @options. @last_image_name = image || docker_image end def push update_auth_token start_time = Time.now logger.info "Pushing Docker Image" command = "docker push #{last_image_name}" log = ".ufo/log/docker.log" if @options[:quiet] success = execute(command, log: log) unless success logger.info "ERROR: The docker image fail to push.".color(:red) exit 1 end took = Time.now - start_time logger.info "Took #{pretty_time(took)}" end def builder @builder ||= Builder.new(@options.merge(image: last_image_name)) end def update_auth_token auth = Ufo::Ecr::Auth.new(last_image_name) # wont update auth token unless the image being pushed in the ECR image format auth.update end end end
Version data entries
22 entries across 22 versions & 1 rubygems