Sha256: bb59d726a20175c81d0a43eb5a8bd90a0c559f04344877f1cf35a23e0ad2250a
Contents?: true
Size: 1.17 KB
Versions: 8
Compression:
Stored size: 1.17 KB
Contents
#!/usr/bin/env ruby require 'drydock' opts = Drydock::RuntimeOptions.parse!(ARGV) STDOUT.sync = true Drydock.logger = Drydock::Logger.new(STDOUT).tap do |l| l.level = opts.log_level l.formatter = Drydock::Formatter.new end build_opts = {} build_opts[:event_handler] = Proc.new do |event, is_new, serial, event_type| long_id = event.id.to_s short_id = if long_id.include?(':') || long_id.include?('/') long_id else long_id.slice(0, 12) end if is_new Drydock.logger.info(message: "#{event_type.to_s.capitalize} #{short_id} #{event.status}") else Drydock.logger.debug(message: "#{event_type.to_s.capitalize} #{short_id} #{event.status}") end end build_opts[:cache] = Drydock::ObjectCaches::FilesystemCache.new if opts.cache Drydock.build(build_opts) do |project| Drydock.logger.info Drydock.banner filename = ARGV.first || 'Drydockfile' filename = "#{filename}/Drydockfile" if File.directory?(filename) unless File.exist?(filename) Drydock.logger.error "Cannot find file #{filename} in #{Dir.pwd}" exit 1 end contents = File.read(filename) Drydock.logger.info "Loaded #{contents.length} bytes from #{filename}" [contents, filename] end
Version data entries
8 entries across 8 versions & 1 rubygems