Class: AptStageFromTarball

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/apt_stage_from_tarball.rb

Instance Method Summary collapse

Methods included from Logging

#fatal, #logger, logger

Constructor Details

#initialize(tarball_path = nil) ⇒ AptStageFromTarball

Returns a new instance of AptStageFromTarball.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/apt_stage_from_tarball.rb', line 12

def initialize(tarball_path = nil)
  @tarball_path = tarball_path
  @manifest_json_file_name = AptStageArtifacts::MANIFEST_JSON_FILENAME
  @log_level = Logger::INFO

  @script_name = File.basename($PROGRAM_NAME)
  @version_string = "Version #{AptStageArtifacts::VERSION}"

  # Keep a list of puppet versions that will require a freight-cache update
  @cache_update_versions = []

  # External commands
  @apt_add_to_freight_library_command = 'apt-add-to-freight-library'
  @apt_update_freight_cache_command = 'apt-update-freight-cache'
end

Instance Method Details

#runObject



28
29
30
31
32
33
34
35
36
# File 'lib/apt_stage_from_tarball.rb', line 28

def run
  logger.info @version_string
  check_for_external_commands
  extract_tarball
  add_artifacts_to_freight_library
  update_freight_cache
  cleanup_tarball_directory
  logger.info 'Freight artifact staging successful.'
end