Class: Lexicon::Cli::Extension::RemoteExtension

Inherits:
ExtensionBase show all
Defined in:
lib/lexicon/cli/extension/remote_extension.rb

Instance Method Summary collapse

Instance Method Details

#boot(container) ⇒ Object

Parameters:

  • container (Corindon::DependencyInjection::Container)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/lexicon/cli/extension/remote_extension.rb', line 8

def boot(container)
  register_parameters(
    container,
    {
      'lexicon.common.remote.endpoint' => ENV.fetch('MINIO_HOST', 'https://io.ekylibre.dev'),
      'lexicon.common.remote.access_key_id' => ENV.fetch('MINIO_ACCESS_KEY', nil),
      'lexicon.common.remote.secret_access_key' => ENV.fetch('MINIO_SECRET_KEY', nil),
      'lexicon.common.remote.force_path_style' => true,
      'lexicon.common.remote.region' => 'us-east-1',
    }
  )

  container.add_definition(Lexicon::Common::Remote::PackageDownloader) do
    args(
      s3: Lexicon::Common::Remote::S3Client,
      out_dir: CommonExtension::PACKAGE_DIR,
      package_loader: Lexicon::Common::Package::DirectoryPackageLoader
    )
  end
  container.add_definition(Lexicon::Common::Remote::PackageUploader) { args(s3: Lexicon::Common::Remote::S3Client) }
  container.add_definition(Lexicon::Common::Remote::S3Client) { args(raw: Aws::S3::Client) }
  container.add_definition(Aws::S3::Client) do
    args(
      endpoint: param('lexicon.common.remote.endpoint'),
      access_key_id: param('lexicon.common.remote.access_key_id'),
      secret_access_key: param('lexicon.common.remote.secret_access_key'),
      force_path_style: param('lexicon.common.remote.force_path_style'),
      region: param('lexicon.common.remote.region'),
    )
  end
end

#commandsObject



40
41
42
43
44
45
# File 'lib/lexicon/cli/extension/remote_extension.rb', line 40

def commands
  proc do
    desc 'remote', 'Minio related commands'
    subcommand 'remote', Command::RemoteCommand
  end
end