Class: CemAcpt::ImageBuilder::Exec::Gcloud

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/cem_acpt/image_builder/exec.rb

Constant Summary

Constants included from Logging

Logging::LEVEL_MAP

Instance Method Summary collapse

Methods included from Logging

current_log_config, #current_log_config, current_log_format, #current_log_format, #current_log_level, current_log_level, included, #logger, logger, new_log_config, #new_log_config, new_log_formatter, #new_log_formatter, #new_log_level, new_log_level, #new_logger, new_logger, verbose?, #verbose?

Constructor Details

#initialize(config) ⇒ Gcloud

Returns a new instance of Gcloud.



23
24
25
26
# File 'lib/cem_acpt/image_builder/exec.rb', line 23

def initialize(config)
  @config = config
  verify_gcloud!
end

Instance Method Details

#run(*command) ⇒ Hash

Run a gcloud command

Returns:

  • (Hash)

    JSON output of the command

Raises:

  • (RuntimeError)

    if the command fails



31
32
33
34
35
# File 'lib/cem_acpt/image_builder/exec.rb', line 31

def run(*command)
  formatted = format_command(*command)
  logger.debug('Exec') { "Running command: #{formatted}" }
  gcloud(formatted)
end