ruby-terraform 0.65.0.pre.14 → 0.65.0.pre.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,17 +5,59 @@ require_relative '../options/common'
5
5
 
6
6
  module RubyTerraform
7
7
  module Commands
8
+ # Wraps the +terraform providers mirror+ command which saves local copies of
9
+ # all required provider plugins.
10
+ #
11
+ # Populates a local directory with copies of the provider plugins needed for
12
+ # the current configuration, so that the directory can be used either
13
+ # directly as a filesystem mirror or as the basis for a network mirror and
14
+ # thus obtain those providers without access to their origin registries in
15
+ # future.
16
+ #
17
+ # The mirror directory will contain JSON index files that can be published
18
+ # along with the mirrored packages on a static HTTP file server to produce a
19
+ # network mirror. Those index files will be ignored if the directory is used
20
+ # instead as a local filesystem mirror.
21
+ #
22
+ # For options accepted on construction, see {#initialize}.
23
+ #
24
+ # When executing an instance of {ProvidersMirror} via {#execute}, the
25
+ # following options are supported:
26
+ #
27
+ # * +:directory+: the directory to populate with the mirrored provider
28
+ # plugins.
29
+ # * +:chdir+: the path of a working directory to switch to before executing
30
+ # the given subcommand.
31
+ # * +:platform+: the target platform to build a mirror for; by default
32
+ # Terraform will obtain plugin packages suitable for the platform where
33
+ # you run this command; target names consist of an operating system and a
34
+ # CPU architecture; for example, "linux_amd64" selects the Linux operating
35
+ # system running on an AMD64 or x86_64 CPU; each provider is available
36
+ # only for a limited set of target platforms; if both +:platform+ and
37
+ # +:platforms+ are provided, all platforms will be passed to Terraform.
38
+ # * +:platforms+: an array of target platforms to build a mirror for for;
39
+ # see +:platform+ for more details; if both +:platform+ and +:platforms+
40
+ # are provided, all platforms will be passed to Terraform.
41
+ #
42
+ # @example Basic Invocation
43
+ # RubyTerraform::Commands::PlatformsMirror.new.execute(
44
+ # directory: './plugins',
45
+ # platforms: ["windows_amd64", "darwin_amd64", "linux_amd64"])
46
+ #
8
47
  class ProvidersMirror < Base
9
48
  include RubyTerraform::Options::Common
10
49
 
50
+ # @!visibility private
11
51
  def subcommands
12
52
  %w[providers mirror]
13
53
  end
14
54
 
55
+ # @!visibility private
15
56
  def options
16
57
  %w[-platform] + super
17
58
  end
18
59
 
60
+ # @!visibility private
19
61
  def arguments(parameters)
20
62
  [parameters[:directory]]
21
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyTerraform
4
- VERSION = '0.65.0.pre.14'
4
+ VERSION = '0.65.0.pre.15'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.65.0.pre.14
4
+ version: 0.65.0.pre.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-24 00:00:00.000000000 Z
11
+ date: 2021-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: immutable-struct