Module: Drydock
- Defined in:
- lib/drydock.rb,
lib/drydock/phase.rb,
lib/drydock/errors.rb,
lib/drydock/logger.rb,
lib/drydock/drydock.rb,
lib/drydock/project.rb,
lib/drydock/cli_flags.rb,
lib/drydock/formatters.rb,
lib/drydock/tar_writer.rb,
lib/drydock/phase_chain.rb,
lib/drydock/plugins/apk.rb,
lib/drydock/plugins/npm.rb,
lib/drydock/file_manager.rb,
lib/drydock/plugins/base.rb,
lib/drydock/stream_monitor.rb,
lib/drydock/runtime_options.rb,
lib/drydock/container_config.rb,
lib/drydock/image_repository.rb,
lib/drydock/plugins/rubygems.rb,
lib/drydock/instructions/base.rb,
lib/drydock/instructions/copy.rb,
lib/drydock/object_caches/base.rb,
lib/drydock/ignorefile_definition.rb,
lib/drydock/object_caches/no_cache.rb,
lib/drydock/plugins/package_manager.rb,
lib/drydock/object_caches/in_memory_cache.rb,
lib/drydock/object_caches/filesystem_cache.rb
Overview
Drydock is a command line program that provides a DSL for you to create your own build pipeline for your docker images. See README for more information and background on the design.
Defined Under Namespace
Modules: Formatters, Instructions, ObjectCaches, Plugins Classes: CliFlags, ContainerConfig, ExecutionError, FileManager, Formatter, IgnorefileDefinition, ImageRepository, InsufficientVersionError, InvalidCommandExecutionError, InvalidInstructionError, Logger, OperationError, Phase, PhaseChain, Project, RuntimeOptions, StreamMonitor, TarWriter
Class Method Summary collapse
-
.banner ⇒ String
The application's banner.
-
.build(build_opts = {}) {|project| ... } ⇒ Object
Create a new project, then run and finalize the build.
- .from(repo, opts = {}, &blk) ⇒ Object
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .version ⇒ Object
Class Method Details
.banner ⇒ String
The application's banner.
10 11 12 |
# File 'lib/drydock/drydock.rb', line 10 def self. "Drydock v#{Drydock.version}" end |
.build(build_opts = {}) {|project| ... } ⇒ Object
Create a new project, then run and finalize the build.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/drydock/drydock.rb', line 24 def self.build(build_opts = {}, &blk) Project.new(build_opts).tap do |project| dryfile, dryfilename = yield project Dir.chdir(File.dirname(dryfilename)) Drydock.logger.info("Working directory set to #{Dir.pwd}") begin catch :done do project.instance_eval(dryfile, dryfilename) end rescue => e Drydock.logger.error("Error processing #{dryfilename}:") Drydock.logger.error(message: "#{e.class}: #{e.}") e.backtrace.each do |backtrace| Drydock.logger.debug(message: "#{backtrace}", indent: 1) end ensure Drydock.logger.info("Cleaning up") project.finalize! end end end |
.from(repo, opts = {}, &blk) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/drydock/drydock.rb', line 48 def self.from(repo, opts = {}, &blk) opts = opts.clone tag = opts.delete(:tag, 'latest') build(opts).tap do |project| project.from(repo, tag) yield project end end |
.logger ⇒ Object
58 59 60 |
# File 'lib/drydock/drydock.rb', line 58 def self.logger @logger ||= Logger.new(File.new('/dev/null', 'w+')) end |
.logger=(logger) ⇒ Object
62 63 64 |
# File 'lib/drydock/drydock.rb', line 62 def self.logger=(logger) @logger = logger end |
.version ⇒ Object
66 67 68 69 |
# File 'lib/drydock/drydock.rb', line 66 def self.version version_file = File.join(File.dirname(__FILE__), '..', '..', 'VERSION') File.exist?(version_file) ? File.read(version_file).chomp : "" end |