Sha256: 664308f8db23fd2e716856fa347c053aefceafe0642ea0e8284f8cc4bd3cfbbb
Contents?: true
Size: 1.37 KB
Versions: 11
Compression:
Stored size: 1.37 KB
Contents
require 'active_support/core_ext/module/delegation' class Ufo::Docker class Pusher include Ufo::Util delegate :full_image_name, to: :builder attr_reader :last_image_name def initialize(image, options) @options = options @last_image_name = image || full_image_name end def push update_auth_token start_time = Time.now message = "Pushed #{last_image_name} docker image." if @options[:noop] message = "NOOP #{message}" else command = "docker push #{last_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 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 if auth.ecr_image? end # full_image - does not include the tag def image_name setting.data["image"] end def setting @setting ||= Ufo::Setting.new(Ufo.root) end end end
Version data entries
11 entries across 11 versions & 1 rubygems