rake_terraform 1.23.0.pre.3 → 1.23.0.pre.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b62db8253aeda8f242695905156bab6ce00f691af97bac4f82783cef34a563
4
- data.tar.gz: 8c821030c9fdc26fd1a82783381845432d10b4a84048afe80bf3714c8262ea43
3
+ metadata.gz: d4ea25d54d9b22e653aa967f95ab25637ce3deba334b14c939a28058c34101c2
4
+ data.tar.gz: 445c0ddf177a6bf258bd48b67e43ece959f5a32a3107dc5559844e1f2af0b81c
5
5
  SHA512:
6
- metadata.gz: 9928612c0570bf6a9a3da486b66db61c57194aec3982ba2bf470ab97d250989dba353ba425d370d9013eea2460af65b2e84a33a6489af00235164a8fc723e033
7
- data.tar.gz: 539917ba32caceb9e5ec84ac41d5a406d11e67d8fcfd5efefa63736d483d9ce37487f6a1089681cb91e952a6575b659dede8914532f0388a18bef7264f53773c
6
+ metadata.gz: 709d8724b84f07690ecd598de375d8a1489804416e4ab74b5dd81acf6230c06cbe111a5724dafbc74d8e7123d8a315b368f39cde464006fb775f7793103bec08
7
+ data.tar.gz: 06106706f076f87d53ea99a1e82e1383afa04aaaea1b15f11a50627f22e20476230e2f6dd40b641c4878d7736a487201ecb52a654dd41960997785a362bd09f7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_terraform (1.23.0.pre.3)
4
+ rake_terraform (1.23.0.pre.4)
5
5
  colored2 (~> 3.1)
6
6
  rake_dependencies (~> 3.1)
7
7
  rake_factory (~> 0.23)
@@ -10,7 +10,7 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.2.3)
13
+ activesupport (7.0.3)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
@@ -20,11 +20,11 @@ GEM
20
20
  ast (2.4.2)
21
21
  coderay (1.1.3)
22
22
  colored2 (3.1.2)
23
- concurrent-ruby (1.1.9)
23
+ concurrent-ruby (1.1.10)
24
24
  diff-lcs (1.5.0)
25
25
  docile (1.4.0)
26
26
  excon (0.92.0)
27
- fakefs (1.4.1)
27
+ fakefs (1.8.0)
28
28
  faraday (1.10.0)
29
29
  faraday-em_http (~> 1.0)
30
30
  faraday-em_synchrony (~> 1.0)
@@ -90,7 +90,7 @@ GEM
90
90
  sawyer (~> 0.8.0, >= 0.5.3)
91
91
  open4 (1.3.4)
92
92
  parallel (1.22.1)
93
- parser (3.1.1.0)
93
+ parser (3.1.2.0)
94
94
  ast (~> 2.4.1)
95
95
  pry (0.14.1)
96
96
  coderay (~> 1.1)
@@ -126,7 +126,7 @@ GEM
126
126
  rb-fsevent (0.11.1)
127
127
  rb-inotify (0.10.1)
128
128
  ffi (~> 1.0)
129
- regexp_parser (2.2.1)
129
+ regexp_parser (2.4.0)
130
130
  rexml (3.2.5)
131
131
  rspec (3.11.0)
132
132
  rspec-core (~> 3.11.0)
@@ -150,14 +150,14 @@ GEM
150
150
  rubocop-ast (>= 1.16.0, < 2.0)
151
151
  ruby-progressbar (~> 1.7)
152
152
  unicode-display_width (>= 1.4.0, < 3.0)
153
- rubocop-ast (1.16.0)
153
+ rubocop-ast (1.18.0)
154
154
  parser (>= 3.1.1.0)
155
155
  rubocop-rake (0.6.0)
156
156
  rubocop (~> 1.0)
157
- rubocop-rspec (2.9.0)
157
+ rubocop-rspec (2.11.1)
158
158
  rubocop (~> 1.19)
159
159
  ruby-progressbar (1.11.0)
160
- ruby-terraform (1.4.0)
160
+ ruby-terraform (1.6.0)
161
161
  immutable-struct (~> 2.4)
162
162
  lino (~> 3.0)
163
163
  ruby2_keywords (0.0.5)
@@ -180,7 +180,7 @@ GEM
180
180
  concurrent-ruby (~> 1.0)
181
181
  unicode-display_width (2.1.0)
182
182
  webrick (1.7.0)
183
- yard (0.9.27)
183
+ yard (0.9.28)
184
184
  webrick (~> 1.7.0)
185
185
 
186
186
  PLATFORMS
@@ -207,4 +207,4 @@ DEPENDENCIES
207
207
  yard
208
208
 
209
209
  BUNDLED WITH
210
- 2.3.11
210
+ 2.3.17
@@ -11,6 +11,8 @@ module RakeTerraform
11
11
  parameter :source_directory, required: true
12
12
  parameter :work_directory, required: true
13
13
 
14
+ parameter :environment, default: {}
15
+
14
16
  parameter :backend_config
15
17
 
16
18
  parameter :vars, default: {}
@@ -20,6 +20,8 @@ module RakeTerraform
20
20
  parameter :source_directory, required: true
21
21
  parameter :work_directory, required: true
22
22
 
23
+ parameter :environment, default: {}
24
+
23
25
  parameter :backend_config
24
26
 
25
27
  parameter :vars, default: {}
@@ -35,42 +37,57 @@ module RakeTerraform
35
37
 
36
38
  parameter :ensure_task_name, default: :'terraform:ensure'
37
39
 
38
- # rubocop:disable Metrics/BlockLength
39
-
40
- action do |t|
41
- Colored2.disable! if t.no_color
40
+ action do |task|
41
+ Colored2.disable! if task.no_color
42
42
 
43
43
  module_directory =
44
- File.join(FileUtils.pwd, t.source_directory)
44
+ File.join(FileUtils.pwd, task.source_directory)
45
45
  configuration_directory =
46
- File.join(t.work_directory, t.source_directory)
46
+ File.join(task.work_directory, task.source_directory)
47
47
 
48
- Kernel.puts "Destroying #{t.configuration_name}".cyan
48
+ Kernel.puts "Destroying #{task.configuration_name}".cyan
49
+
50
+ prepare_configuration_directory(configuration_directory)
51
+ init_configuration(configuration_directory, module_directory, task)
52
+ destroy_configuration(configuration_directory, task)
53
+ end
49
54
 
55
+ def prepare_configuration_directory(configuration_directory)
50
56
  FileUtils.rm_rf(configuration_directory)
51
57
  FileUtils.mkdir_p(configuration_directory)
58
+ end
52
59
 
60
+ def init_configuration(configuration_directory, module_directory, task)
53
61
  RubyTerraform.init(
54
- chdir: configuration_directory,
55
- from_module: module_directory,
56
- backend_config: t.backend_config,
57
- no_color: t.no_color,
58
- input: t.input
62
+ {
63
+ chdir: configuration_directory,
64
+ from_module: module_directory,
65
+ backend_config: task.backend_config,
66
+ no_color: task.no_color,
67
+ input: task.input
68
+ },
69
+ { environment: task.environment }
59
70
  )
71
+ end
72
+
73
+ # rubocop:disable Metrics/MethodLength
74
+ def destroy_configuration(configuration_directory, task)
60
75
  RubyTerraform.destroy(
61
- chdir: configuration_directory,
62
- auto_approve: true,
63
- input: t.input,
64
- no_color: t.no_color,
65
- no_backup: t.no_backup,
66
- backup: t.backup_file,
67
- state: t.state_file,
68
- vars: t.vars,
69
- var_file: t.var_file
76
+ {
77
+ chdir: configuration_directory,
78
+ auto_approve: true,
79
+ input: task.input,
80
+ no_color: task.no_color,
81
+ no_backup: task.no_backup,
82
+ backup: task.backup_file,
83
+ state: task.state_file,
84
+ vars: task.vars,
85
+ var_file: task.var_file
86
+ },
87
+ { environment: task.environment }
70
88
  )
71
89
  end
72
-
73
- # rubocop:enable Metrics/BlockLength
90
+ # rubocop:enable Metrics/MethodLength
74
91
  end
75
92
  end
76
93
  end
@@ -20,6 +20,8 @@ module RakeTerraform
20
20
  parameter :source_directory, required: true
21
21
  parameter :work_directory, required: true
22
22
 
23
+ parameter :environment, default: {}
24
+
23
25
  parameter :backend_config
24
26
 
25
27
  parameter :state_file
@@ -31,35 +33,52 @@ module RakeTerraform
31
33
 
32
34
  parameter :ensure_task_name, default: :'terraform:ensure'
33
35
 
34
- action do |t|
35
- Colored2.disable! if t.no_color
36
+ action do |task|
37
+ Colored2.disable! if task.no_color
36
38
 
37
39
  module_directory =
38
- File.join(FileUtils.pwd, t.source_directory)
40
+ File.join(FileUtils.pwd, task.source_directory)
39
41
  configuration_directory =
40
- File.join(t.work_directory, t.source_directory)
42
+ File.join(task.work_directory, task.source_directory)
43
+
44
+ Kernel.puts("Output of #{task.configuration_name}".cyan)
45
+
46
+ prepare_configuration_directory(configuration_directory)
47
+ init_configuration(configuration_directory, module_directory, task)
48
+ output = output_configuration(configuration_directory, task)
41
49
 
42
- Kernel.puts("Output of #{t.configuration_name}".cyan)
50
+ Kernel.puts(output) unless task.no_print_output
51
+
52
+ output
53
+ end
43
54
 
55
+ def prepare_configuration_directory(configuration_directory)
44
56
  FileUtils.rm_rf(configuration_directory)
45
57
  FileUtils.mkdir_p(configuration_directory)
58
+ end
46
59
 
60
+ def init_configuration(configuration_directory, module_directory, task)
47
61
  RubyTerraform.init(
48
- chdir: configuration_directory,
49
- from_module: module_directory,
50
- backend_config: t.backend_config,
51
- no_color: t.no_color,
52
- input: t.input
53
- )
54
- output = RubyTerraform.output(
55
- chdir: configuration_directory,
56
- no_color: t.no_color,
57
- state: t.state_file
62
+ {
63
+ chdir: configuration_directory,
64
+ from_module: module_directory,
65
+ backend_config: task.backend_config,
66
+ no_color: task.no_color,
67
+ input: task.input
68
+ },
69
+ { environment: task.environment }
58
70
  )
71
+ end
59
72
 
60
- Kernel.puts(output) unless t.no_print_output
61
-
62
- output
73
+ def output_configuration(configuration_directory, task)
74
+ RubyTerraform.output(
75
+ {
76
+ chdir: configuration_directory,
77
+ no_color: task.no_color,
78
+ state: task.state_file
79
+ },
80
+ { environment: task.environment }
81
+ )
63
82
  end
64
83
  end
65
84
  end
@@ -20,6 +20,8 @@ module RakeTerraform
20
20
  parameter :source_directory, required: true
21
21
  parameter :work_directory, required: true
22
22
 
23
+ parameter :environment, default: {}
24
+
23
25
  parameter :backend_config
24
26
 
25
27
  parameter :vars, default: {}
@@ -35,37 +37,56 @@ module RakeTerraform
35
37
 
36
38
  parameter :ensure_task_name, default: :'terraform:ensure'
37
39
 
38
- action do |t|
39
- Colored2.disable! if t.no_color
40
+ action do |task|
41
+ Colored2.disable! if task.no_color
40
42
 
41
43
  module_directory =
42
- File.join(FileUtils.pwd, t.source_directory)
44
+ File.join(FileUtils.pwd, task.source_directory)
43
45
  configuration_directory =
44
- File.join(t.work_directory, t.source_directory)
46
+ File.join(task.work_directory, task.source_directory)
45
47
 
46
48
  Kernel.puts("Planning #{configuration_name}".cyan)
47
49
 
50
+ prepare_configuration_directory(configuration_directory)
51
+ init_configuration(configuration_directory, module_directory, task)
52
+ plan_configuration(configuration_directory, task)
53
+ end
54
+
55
+ def prepare_configuration_directory(configuration_directory)
48
56
  FileUtils.rm_rf(configuration_directory)
49
57
  FileUtils.mkdir_p(configuration_directory)
58
+ end
50
59
 
60
+ def init_configuration(configuration_directory, module_directory, task)
51
61
  RubyTerraform.init(
52
- chdir: configuration_directory,
53
- from_module: module_directory,
54
- backend_config: t.backend_config,
55
- no_color: t.no_color,
56
- input: t.input
62
+ {
63
+ chdir: configuration_directory,
64
+ from_module: module_directory,
65
+ backend_config: task.backend_config,
66
+ no_color: task.no_color,
67
+ input: task.input
68
+ },
69
+ { environment: task.environment }
57
70
  )
71
+ end
72
+
73
+ # rubocop:disable Metrics/MethodLength
74
+ def plan_configuration(configuration_directory, task)
58
75
  RubyTerraform.plan(
59
- chdir: configuration_directory,
60
- input: t.input,
61
- no_color: t.no_color,
62
- destroy: t.destroy,
63
- state: t.state_file,
64
- plan: t.plan_file,
65
- vars: t.vars,
66
- var_file: t.var_file
76
+ {
77
+ chdir: configuration_directory,
78
+ input: task.input,
79
+ no_color: task.no_color,
80
+ destroy: task.destroy,
81
+ state: task.state_file,
82
+ plan: task.plan_file,
83
+ vars: task.vars,
84
+ var_file: task.var_file
85
+ },
86
+ { environment: task.environment }
67
87
  )
68
88
  end
89
+ # rubocop:enable Metrics/MethodLength
69
90
  end
70
91
  end
71
92
  end
@@ -20,6 +20,8 @@ module RakeTerraform
20
20
  parameter :source_directory, required: true
21
21
  parameter :work_directory, required: true
22
22
 
23
+ parameter :environment, default: {}
24
+
23
25
  parameter :backend_config
24
26
 
25
27
  parameter :vars, default: {}
@@ -35,42 +37,57 @@ module RakeTerraform
35
37
 
36
38
  parameter :ensure_task_name, default: :'terraform:ensure'
37
39
 
38
- # rubocop:disable Metrics/BlockLength
39
-
40
- action do |t|
41
- Colored2.disable! if t.no_color
40
+ action do |task|
41
+ Colored2.disable! if task.no_color
42
42
 
43
43
  module_directory =
44
- File.join(FileUtils.pwd, t.source_directory)
44
+ File.join(FileUtils.pwd, task.source_directory)
45
45
  configuration_directory =
46
- File.join(t.work_directory, t.source_directory)
46
+ File.join(task.work_directory, task.source_directory)
47
47
 
48
- Kernel.puts("Provisioning #{t.configuration_name}".cyan)
48
+ Kernel.puts("Provisioning #{task.configuration_name}".cyan)
49
+
50
+ prepare_configuration_directory(configuration_directory)
51
+ init_configuration(configuration_directory, module_directory, task)
52
+ apply_configuration(configuration_directory, task)
53
+ end
49
54
 
55
+ def prepare_configuration_directory(configuration_directory)
50
56
  FileUtils.rm_rf(configuration_directory)
51
57
  FileUtils.mkdir_p(configuration_directory)
58
+ end
52
59
 
60
+ def init_configuration(configuration_directory, module_directory, task)
53
61
  RubyTerraform.init(
54
- chdir: configuration_directory,
55
- from_module: module_directory,
56
- backend_config: t.backend_config,
57
- no_color: t.no_color,
58
- input: t.input
62
+ {
63
+ chdir: configuration_directory,
64
+ from_module: module_directory,
65
+ backend_config: task.backend_config,
66
+ no_color: task.no_color,
67
+ input: task.input
68
+ },
69
+ { environment: task.environment }
59
70
  )
71
+ end
72
+
73
+ # rubocop:disable Metrics/MethodLength
74
+ def apply_configuration(configuration_directory, task)
60
75
  RubyTerraform.apply(
61
- chdir: configuration_directory,
62
- auto_approve: true,
63
- input: t.input,
64
- no_color: t.no_color,
65
- no_backup: t.no_backup,
66
- backup: t.backup_file,
67
- state: t.state_file,
68
- vars: t.vars,
69
- var_file: t.var_file
76
+ {
77
+ chdir: configuration_directory,
78
+ auto_approve: true,
79
+ input: task.input,
80
+ no_color: task.no_color,
81
+ no_backup: task.no_backup,
82
+ backup: task.backup_file,
83
+ state: task.state_file,
84
+ vars: task.vars,
85
+ var_file: task.var_file
86
+ },
87
+ { environment: task.environment }
70
88
  )
71
89
  end
72
-
73
- # rubocop:enable Metrics/BlockLength
90
+ # rubocop:enable Metrics/MethodLength
74
91
  end
75
92
  end
76
93
  end
@@ -20,6 +20,8 @@ module RakeTerraform
20
20
  parameter :source_directory, required: true
21
21
  parameter :work_directory, required: true
22
22
 
23
+ parameter :environment, default: {}
24
+
23
25
  parameter :backend_config
24
26
 
25
27
  parameter :debug, default: false
@@ -28,29 +30,46 @@ module RakeTerraform
28
30
 
29
31
  parameter :ensure_task_name, default: :'terraform:ensure'
30
32
 
31
- action do |t|
32
- Colored2.disable! if t.no_color
33
+ action do |task|
34
+ Colored2.disable! if task.no_color
33
35
 
34
36
  module_directory =
35
- File.join(FileUtils.pwd, t.source_directory)
37
+ File.join(FileUtils.pwd, task.source_directory)
36
38
  configuration_directory =
37
- File.join(t.work_directory, t.source_directory)
39
+ File.join(task.work_directory, task.source_directory)
40
+
41
+ Kernel.puts("Validating #{task.configuration_name}".cyan)
38
42
 
39
- Kernel.puts("Validating #{t.configuration_name}".cyan)
43
+ prepare_configuration_directory(configuration_directory)
44
+ init_configuration(configuration_directory, module_directory, task)
45
+ validate_configuration(configuration_directory, task)
46
+ end
40
47
 
48
+ def prepare_configuration_directory(configuration_directory)
41
49
  FileUtils.rm_rf(configuration_directory)
42
50
  FileUtils.mkdir_p(configuration_directory)
51
+ end
43
52
 
53
+ def init_configuration(configuration_directory, module_directory, task)
44
54
  RubyTerraform.init(
45
- chdir: configuration_directory,
46
- from_module: module_directory,
47
- backend_config: t.backend_config,
48
- no_color: t.no_color,
49
- input: t.input
55
+ {
56
+ chdir: configuration_directory,
57
+ from_module: module_directory,
58
+ backend_config: task.backend_config,
59
+ no_color: task.no_color,
60
+ input: task.input
61
+ },
62
+ { environment: task.environment }
50
63
  )
64
+ end
65
+
66
+ def validate_configuration(configuration_directory, task)
51
67
  RubyTerraform.validate(
52
- chdir: configuration_directory,
53
- no_color: t.no_color
68
+ {
69
+ chdir: configuration_directory,
70
+ no_color: task.no_color
71
+ },
72
+ { environment: task.environment }
54
73
  )
55
74
  end
56
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RakeTerraform
4
- VERSION = '1.23.0.pre.3'
4
+ VERSION = '1.23.0.pre.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0.pre.3
4
+ version: 1.23.0.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-09 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2