Sha256: 4fd10037e48abe6ce25fdccf248b930322ebe804af176cc34dda614dc0288ad4
Contents?: true
Size: 897 Bytes
Versions: 38
Compression:
Stored size: 897 Bytes
Contents
require 'rake_factory' require 'docker' module RakeDocker module Tasks class Push < RakeFactory::Task default_name :push default_description RakeFactory::DynamicValue.new { |t| "Push #{t.image_name} image to repository" } parameter :image_name, :required => true parameter :repository_url, :required => true parameter :credentials parameter :tags, :required => true action do |t| Docker.authenticate!(t.credentials) if t.credentials images = Docker::Image.all(filter: t.repository_url) if images.empty? raise ImageNotFound, "No image found for repository: '#{t.repository_url}'" end image = images.first t.tags.each do |tag| image.push(nil, tag: tag) do |chunk| Output.print chunk end end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems