Sha256: 21b2d7a6ecdcf57da352bdcd17e69e750a8496718f71726b27d5304d8b3e4ab0
Contents?: true
Size: 1.63 KB
Versions: 4
Compression:
Stored size: 1.63 KB
Contents
module Ufo class Docker < Command autoload :Builder, 'ufo/docker/builder' autoload :Dockerfile, 'ufo/docker/dockerfile' autoload :Cleaner, 'ufo/docker/cleaner' desc "build", "builds docker image" long_desc Help.text("docker:build") option :push, type: :boolean, default: false def build builder = Docker::Builder.new(options) builder.build builder.push if options[:push] end desc "base", "builds docker image from Dockerfile.base and update current Dockerfile" long_desc Help.text("docker:base") option :push, type: :boolean, default: true def base builder = Docker::Builder.new(options.dup.merge( image_namespace: "base", dockerfile: "Dockerfile.base" )) builder.build builder.push if options[:push] builder.update_dockerfile Docker::Cleaner.new(builder.image_name, options.merge(tag_prefix: "base")).cleanup Ecr::Cleaner.new(builder.image_name, options.merge(tag_prefix: "base")).cleanup end desc "name", "displays the full docker image with tag that will be generated" option :generate, type: :boolean, default: false, desc: "Generate a name without storing it" long_desc Help.text("docker:name") def name full_image_name = Docker::Builder.new(options).full_image_name puts full_image_name end desc "clean IMAGE_NAME", "Cleans up old images. Keeps a specified amount." option :keep, type: :numeric, default: 3 option :tag_prefix, default: "ufo" long_desc Help.text("docker:clean") def clean(image_name) Docker::Cleaner.new(image_name, options).cleanup end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ufo-2.3.0 | lib/ufo/docker.rb |
ufo-2.2.2 | lib/ufo/docker.rb |
ufo-2.2.1 | lib/ufo/docker.rb |
ufo-2.2.0 | lib/ufo/docker.rb |