Class: Itamae::Backend::Docker

Inherits:
Base
  • Object
show all
Defined in:
lib/itamae/backend.rb

Instance Attribute Summary

Attributes inherited from Base

#executed_commands

Instance Method Summary collapse

Methods inherited from Base

#get_command, #host_inventory, #initialize, #receive_file, #run_command, #send_directory, #send_file

Constructor Details

This class inherits a constructor from Itamae::Backend::Base

Instance Method Details

#finalizeObject



295
296
297
298
299
300
301
302
303
# File 'lib/itamae/backend.rb', line 295

def finalize
  image = @backend.commit_container
  /\A(?<repo>.+?)(?:|:(?<tag>[^:]+))\z/.match(@options[:tag]) do |m|
    image.tag(repo: m[:repo], tag: m[:tag])
  end
  log_message = "Image created: #{image.id}"
  log_message << ", and tagged as #{@options[:tag]}" if @options[:tag]
  Itamae.logger.info log_message
end