Class: EtnaApp::Config::Set

Inherits:
Etna::Command show all
Includes:
WithEtnaClients, WithLogger
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from Etna::Command

#parent

Instance Method Summary collapse

Methods included from WithLogger

#logger

Methods included from WithEtnaClients

#environment, #exit, exit, #janus_client, #magma_client, #metis_client, #polyphemus_client, #token

Methods inherited from Etna::Command

#completions, #fill_in_missing_params, #find_command, #initialize, parent_scope

Methods included from Etna::CommandOrExecutor

#command_name, #completions_for, #desc, #flag_argspec, #flag_as_parameter, included, #parse_flags, #program_name, #usage

Constructor Details

This class inherits a constructor from Etna::Command

Instance Method Details

#execute(host, ignore_ssl: false) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/commands.rb', line 57

def execute(host, ignore_ssl: false)
  polyphemus_client = Etna::Clients::Polyphemus.new(
      host: host,
      token: token(ignore_environment: true),
      ignore_ssl: ignore_ssl)
  workflow = Etna::Clients::Polyphemus::SetConfigurationWorkflow.new(
      polyphemus_client: polyphemus_client,
      config_file: EtnaApp.config_file_path)
  config = workflow.update_configuration_file(ignore_ssl: ignore_ssl)
  logger&.info("Updated #{config.environment} configuration from #{host}.")
end

#setup(config) ⇒ Object



69
70
71
72
# File 'lib/commands.rb', line 69

def setup(config)
  super
  EtnaApp.instance.setup_logger
end