Sha256: 2556e944fa680d916ef6f9eb93638d9e3c3beff661976ea31368ee714df50e46

Contents?: true

Size: 671 Bytes

Versions: 8

Compression:

Stored size: 671 Bytes

Contents

module Kubes::Docker::Strategy::Push
  class Docker < Base
    def run
      update_auth_token
      start_time = Time.now
      message = "Pushed #{image_name} docker image."
      if @options[:noop]
        message = "NOOP #{message}"
      else
        push
      end
      took = Time.now - start_time
      message << "\nDocker push took #{pretty_time(took)}.".color(:green)
      logger.info message
    end

    def push
      params = args.flatten.join(' ')
      command = "docker push #{params}"
      run_hooks "push" do
        sh(command)
      end
    end

    def update_auth_token
      auth = Kubes::Auth.new(image_name)
      auth.run
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kubes-0.3.5 lib/kubes/docker/strategy/push/docker.rb
kubes-0.3.4 lib/kubes/docker/strategy/push/docker.rb
kubes-0.3.3 lib/kubes/docker/strategy/push/docker.rb
kubes-0.3.2 lib/kubes/docker/strategy/push/docker.rb
kubes-0.3.1 lib/kubes/docker/strategy/push/docker.rb
kubes-0.3.0 lib/kubes/docker/strategy/push/docker.rb
kubes-0.2.6 lib/kubes/docker/strategy/push/docker.rb
kubes-0.2.5 lib/kubes/docker/strategy/push/docker.rb