Sha256: 41b1fc886681caa86c6bfd631d92cab049793939623bb11faad15290b2bb89d8
Contents?: true
Size: 852 Bytes
Versions: 38
Compression:
Stored size: 852 Bytes
Contents
require 'rake_factory' require 'docker' module RakeDocker module Tasks class Tag < RakeFactory::Task default_name :tag default_description RakeFactory::DynamicValue.new { |t| "Tag #{t.image_name} image for repository" } parameter :image_name, :required => true parameter :repository_name, :required => true parameter :repository_url, :required => true parameter :tags, :required => true action do |t| images = Docker::Image.all(filter: t.repository_name) if images.empty? raise ImageNotFound, "No image found with name: '#{t.image_name}'" end image = images.first t.tags.each do |tag| image.tag(repo: t.repository_url, tag: tag, force: true) end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems