rake_terraform 1.13.0 → 1.16.0.pre.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +112 -30
- data/Rakefile +89 -42
- data/bin/console +4 -3
- data/lib/rake_terraform.rb +33 -114
- data/lib/rake_terraform/task_sets.rb +4 -0
- data/lib/rake_terraform/task_sets/all.rb +50 -40
- data/lib/rake_terraform/task_sets/provider.rb +168 -0
- data/lib/rake_terraform/task_sets/terraform.rb +179 -0
- data/lib/rake_terraform/tasks.rb +2 -0
- data/lib/rake_terraform/tasks/destroy.rb +42 -30
- data/lib/rake_terraform/tasks/output.rb +34 -28
- data/lib/rake_terraform/tasks/plan.rb +40 -32
- data/lib/rake_terraform/tasks/provision.rb +42 -31
- data/lib/rake_terraform/tasks/validate.rb +33 -33
- data/lib/rake_terraform/version.rb +3 -1
- data/rake_terraform.gemspec +62 -0
- metadata +132 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54f4546a77a10fe25ee6111abd41b7ba325156e4b76253cc7e1d4255b24de935
|
4
|
+
data.tar.gz: 8484ef226d1ab3c77d0cac23a144694fe048cc77143b6f4ce29c37a77eb6f522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f11a592a17c334d26bb5b5e2f6cf455ecbf88fca1299da651bdf81165724a5353e6f5f3e82cba40dd4fc18a8a34fc8c73ef3df10612274b1acd5cfb926db0c7
|
7
|
+
data.tar.gz: 3fe95e9e5cb1fceae2fd9d89281680baa92a10a1bfa64531a3d0aaac59f6a7ba6c931e740def894df6b48eae23a7fa87cae7b2424a9709d627f39d7d5fa99cef
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,61 +1,103 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rake_terraform (1.
|
4
|
+
rake_terraform (1.16.0.pre.3)
|
5
5
|
colored2 (~> 3.1)
|
6
|
-
rake_dependencies (~> 2
|
7
|
-
rake_factory (
|
8
|
-
ruby-terraform (
|
6
|
+
rake_dependencies (~> 2.9)
|
7
|
+
rake_factory (~> 0.23)
|
8
|
+
ruby-terraform (~> 1.1)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (5.2.
|
13
|
+
activesupport (5.2.6)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
15
|
i18n (>= 0.7, < 2)
|
16
16
|
minitest (~> 5.1)
|
17
17
|
tzinfo (~> 1.1)
|
18
18
|
addressable (2.7.0)
|
19
19
|
public_suffix (>= 2.0.2, < 5.0)
|
20
|
+
ast (2.4.2)
|
21
|
+
coderay (1.1.3)
|
20
22
|
colored2 (3.1.2)
|
21
|
-
concurrent-ruby (1.1.
|
23
|
+
concurrent-ruby (1.1.8)
|
22
24
|
diff-lcs (1.4.4)
|
23
|
-
|
25
|
+
docile (1.3.5)
|
26
|
+
excon (0.81.0)
|
24
27
|
fakefs (0.20.1)
|
25
|
-
faraday (1.1
|
28
|
+
faraday (1.4.1)
|
29
|
+
faraday-excon (~> 1.1)
|
30
|
+
faraday-net_http (~> 1.0)
|
31
|
+
faraday-net_http_persistent (~> 1.1)
|
26
32
|
multipart-post (>= 1.2, < 3)
|
27
|
-
ruby2_keywords
|
28
|
-
|
33
|
+
ruby2_keywords (>= 0.0.4)
|
34
|
+
faraday-excon (1.1.0)
|
35
|
+
faraday-net_http (1.0.1)
|
36
|
+
faraday-net_http_persistent (1.1.0)
|
37
|
+
ffi (1.15.0)
|
38
|
+
formatador (0.2.5)
|
39
|
+
gem-release (2.2.1)
|
40
|
+
guard (2.16.2)
|
41
|
+
formatador (>= 0.2.4)
|
42
|
+
listen (>= 2.7, < 4.0)
|
43
|
+
lumberjack (>= 1.0.12, < 2.0)
|
44
|
+
nenv (~> 0.1)
|
45
|
+
notiffany (~> 0.0)
|
46
|
+
pry (>= 0.9.12)
|
47
|
+
shellany (~> 0.0)
|
48
|
+
thor (>= 0.18.1)
|
49
|
+
guard-compat (1.2.1)
|
50
|
+
guard-rspec (4.7.3)
|
51
|
+
guard (~> 2.1)
|
52
|
+
guard-compat (~> 1.1)
|
53
|
+
rspec (>= 2.99.0, < 4.0)
|
29
54
|
hamster (3.0.0)
|
30
55
|
concurrent-ruby (~> 1.0)
|
31
|
-
i18n (1.8.
|
56
|
+
i18n (1.8.10)
|
32
57
|
concurrent-ruby (~> 1.0)
|
33
|
-
|
58
|
+
immutable-struct (2.4.1)
|
59
|
+
lino (2.7.0)
|
34
60
|
hamster (~> 3.0)
|
35
61
|
open4 (~> 1.3)
|
62
|
+
listen (3.5.1)
|
63
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
64
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
65
|
+
lumberjack (1.2.8)
|
66
|
+
method_source (1.0.0)
|
36
67
|
minitar (0.9)
|
37
|
-
minitest (5.14.
|
68
|
+
minitest (5.14.4)
|
38
69
|
multipart-post (2.1.1)
|
39
|
-
|
70
|
+
nenv (0.3.0)
|
71
|
+
notiffany (0.1.3)
|
72
|
+
nenv (~> 0.1)
|
73
|
+
shellany (~> 0.0)
|
74
|
+
octokit (4.21.0)
|
40
75
|
faraday (>= 0.9)
|
41
76
|
sawyer (~> 0.8.0, >= 0.5.3)
|
42
77
|
open4 (1.3.4)
|
78
|
+
parallel (1.20.1)
|
79
|
+
parser (3.0.1.1)
|
80
|
+
ast (~> 2.4.1)
|
81
|
+
pry (0.14.1)
|
82
|
+
coderay (~> 1.1)
|
83
|
+
method_source (~> 1.0)
|
43
84
|
public_suffix (4.0.6)
|
44
|
-
|
85
|
+
rainbow (3.0.0)
|
86
|
+
rake (13.0.3)
|
45
87
|
rake_circle_ci (0.9.0)
|
46
88
|
colored2 (~> 3.1)
|
47
89
|
excon (~> 0.72)
|
48
90
|
rake_factory (~> 0.23)
|
49
91
|
sshkey (~> 2.0)
|
50
|
-
rake_dependencies (2.
|
92
|
+
rake_dependencies (2.9.0)
|
51
93
|
hamster (~> 3.0)
|
52
94
|
minitar (~> 0.9)
|
53
95
|
rake_factory (~> 0.23)
|
54
96
|
rubyzip (>= 1.3)
|
55
|
-
rake_factory (0.
|
97
|
+
rake_factory (0.29.0)
|
56
98
|
activesupport (>= 4)
|
57
99
|
rake (~> 13.0)
|
58
|
-
rake_github (0.
|
100
|
+
rake_github (0.7.0)
|
59
101
|
colored2 (~> 3.1)
|
60
102
|
octokit (~> 4.16)
|
61
103
|
rake_factory (~> 0.23)
|
@@ -63,36 +105,69 @@ GEM
|
|
63
105
|
rake_gpg (0.14.0)
|
64
106
|
rake_factory (>= 0.23, < 1)
|
65
107
|
ruby_gpg2 (>= 0.6, < 1)
|
66
|
-
rake_ssh (0.
|
108
|
+
rake_ssh (0.6.0)
|
67
109
|
colored2 (~> 3.1)
|
68
110
|
rake_factory (~> 0.23)
|
69
111
|
sshkey (~> 2.0)
|
112
|
+
rb-fsevent (0.11.0)
|
113
|
+
rb-inotify (0.10.1)
|
114
|
+
ffi (~> 1.0)
|
115
|
+
regexp_parser (2.1.1)
|
116
|
+
rexml (3.2.5)
|
70
117
|
rspec (3.10.0)
|
71
118
|
rspec-core (~> 3.10.0)
|
72
119
|
rspec-expectations (~> 3.10.0)
|
73
120
|
rspec-mocks (~> 3.10.0)
|
74
|
-
rspec-core (3.10.
|
121
|
+
rspec-core (3.10.1)
|
75
122
|
rspec-support (~> 3.10.0)
|
76
|
-
rspec-expectations (3.10.
|
123
|
+
rspec-expectations (3.10.1)
|
77
124
|
diff-lcs (>= 1.2.0, < 2.0)
|
78
125
|
rspec-support (~> 3.10.0)
|
79
|
-
rspec-mocks (3.10.
|
126
|
+
rspec-mocks (3.10.2)
|
80
127
|
diff-lcs (>= 1.2.0, < 2.0)
|
81
128
|
rspec-support (~> 3.10.0)
|
82
|
-
rspec-support (3.10.
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
129
|
+
rspec-support (3.10.2)
|
130
|
+
rubocop (1.14.0)
|
131
|
+
parallel (~> 1.10)
|
132
|
+
parser (>= 3.0.0.0)
|
133
|
+
rainbow (>= 2.2.2, < 4.0)
|
134
|
+
regexp_parser (>= 1.8, < 3.0)
|
135
|
+
rexml
|
136
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
137
|
+
ruby-progressbar (~> 1.7)
|
138
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
139
|
+
rubocop-ast (1.5.0)
|
140
|
+
parser (>= 3.0.1.1)
|
141
|
+
rubocop-rake (0.5.1)
|
142
|
+
rubocop
|
143
|
+
rubocop-rspec (2.3.0)
|
144
|
+
rubocop (~> 1.0)
|
145
|
+
rubocop-ast (>= 1.1.0)
|
146
|
+
ruby-progressbar (1.11.0)
|
147
|
+
ruby-terraform (1.1.0)
|
148
|
+
immutable-struct (~> 2.4)
|
149
|
+
lino (~> 2.7)
|
150
|
+
ruby2_keywords (0.0.4)
|
151
|
+
ruby_gpg2 (0.8.0)
|
87
152
|
lino (>= 1.5)
|
88
153
|
rubyzip (2.3.0)
|
89
154
|
sawyer (0.8.2)
|
90
155
|
addressable (>= 2.3.5)
|
91
156
|
faraday (> 0.8, < 2.0)
|
157
|
+
shellany (0.0.1)
|
158
|
+
simplecov (0.21.2)
|
159
|
+
docile (~> 1.1)
|
160
|
+
simplecov-html (~> 0.11)
|
161
|
+
simplecov_json_formatter (~> 0.1)
|
162
|
+
simplecov-html (0.12.3)
|
163
|
+
simplecov_json_formatter (0.1.3)
|
92
164
|
sshkey (2.0.0)
|
165
|
+
thor (1.1.0)
|
93
166
|
thread_safe (0.3.6)
|
94
|
-
tzinfo (1.2.
|
167
|
+
tzinfo (1.2.9)
|
95
168
|
thread_safe (~> 0.1)
|
169
|
+
unicode-display_width (2.0.0)
|
170
|
+
yard (0.9.26)
|
96
171
|
|
97
172
|
PLATFORMS
|
98
173
|
ruby
|
@@ -101,7 +176,9 @@ DEPENDENCIES
|
|
101
176
|
activesupport (~> 5.2)
|
102
177
|
bundler (~> 2.0)
|
103
178
|
fakefs (~> 0.18)
|
104
|
-
gem-release (~> 2.
|
179
|
+
gem-release (~> 2.1)
|
180
|
+
guard (~> 2.16)
|
181
|
+
guard-rspec (~> 4.7)
|
105
182
|
rake (~> 13.0)
|
106
183
|
rake_circle_ci (~> 0.9)
|
107
184
|
rake_github (~> 0.5)
|
@@ -109,6 +186,11 @@ DEPENDENCIES
|
|
109
186
|
rake_ssh (~> 0.4)
|
110
187
|
rake_terraform!
|
111
188
|
rspec (~> 3.9)
|
189
|
+
rubocop (~> 1.12)
|
190
|
+
rubocop-rake (~> 0.5)
|
191
|
+
rubocop-rspec (~> 2.2)
|
192
|
+
simplecov (~> 0.21)
|
193
|
+
yard (~> 0.9)
|
112
194
|
|
113
195
|
BUNDLED WITH
|
114
|
-
2.2.
|
196
|
+
2.2.17
|
data/Rakefile
CHANGED
@@ -1,17 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'yaml'
|
4
|
+
require 'yard'
|
2
5
|
require 'rake_circle_ci'
|
3
6
|
require 'rake_github'
|
4
7
|
require 'rake_ssh'
|
5
8
|
require 'rake_gpg'
|
6
9
|
require 'securerandom'
|
7
10
|
require 'rspec/core/rake_task'
|
11
|
+
require 'rubocop/rake_task'
|
8
12
|
|
9
|
-
task :
|
10
|
-
|
11
|
-
|
13
|
+
task default: %i[
|
14
|
+
library:fix
|
15
|
+
test:unit
|
16
|
+
]
|
12
17
|
|
13
18
|
namespace :encryption do
|
14
19
|
namespace :passphrase do
|
20
|
+
desc 'Generate encryption passphrase for CI GPG key'
|
15
21
|
task :generate do
|
16
22
|
File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
|
17
23
|
f.write(SecureRandom.base64(36))
|
@@ -23,83 +29,124 @@ end
|
|
23
29
|
namespace :keys do
|
24
30
|
namespace :deploy do
|
25
31
|
RakeSSH.define_key_tasks(
|
26
|
-
|
27
|
-
|
32
|
+
path: 'config/secrets/ci/',
|
33
|
+
comment: 'maintainers@infrablocks.io'
|
34
|
+
)
|
28
35
|
end
|
29
36
|
|
30
37
|
namespace :gpg do
|
31
38
|
RakeGPG.define_generate_key_task(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
39
|
+
output_directory: 'config/secrets/ci',
|
40
|
+
name_prefix: 'gpg',
|
41
|
+
owner_name: 'InfraBlocks Maintainers',
|
42
|
+
owner_email: 'maintainers@infrablocks.io',
|
43
|
+
owner_comment: 'rake_terraform CI Key'
|
44
|
+
)
|
37
45
|
end
|
38
46
|
end
|
39
47
|
|
48
|
+
RuboCop::RakeTask.new
|
49
|
+
|
50
|
+
YARD::Rake::YardocTask.new do |t|
|
51
|
+
t.files = ['lib/**/*.rb']
|
52
|
+
t.options = %w[--embed-mixins --output-dir docs]
|
53
|
+
end
|
54
|
+
|
55
|
+
namespace :library do
|
56
|
+
desc 'Run all checks of the library'
|
57
|
+
task check: [:rubocop]
|
58
|
+
|
59
|
+
desc 'Attempt to automatically fix issues with the library'
|
60
|
+
task fix: [:'rubocop:auto_correct']
|
61
|
+
end
|
62
|
+
|
63
|
+
namespace :documentation do
|
64
|
+
desc 'Generate documentation'
|
65
|
+
task generate: [:yard]
|
66
|
+
|
67
|
+
desc 'Commit documentation'
|
68
|
+
task :commit, [:skip] do |_, args|
|
69
|
+
args.with_defaults(skip: 'true')
|
70
|
+
|
71
|
+
skip_ci = args.skip == 'true'
|
72
|
+
|
73
|
+
sh('git', 'commit',
|
74
|
+
'-a',
|
75
|
+
'-m', "Generate latest documentation#{skip_ci ? ' [ci skip]' : ''}")
|
76
|
+
end
|
77
|
+
|
78
|
+
desc 'Update documentation'
|
79
|
+
task update: %i[generate commit]
|
80
|
+
end
|
81
|
+
|
82
|
+
namespace :test do
|
83
|
+
RSpec::Core::RakeTask.new(:unit)
|
84
|
+
end
|
85
|
+
|
40
86
|
RakeCircleCI.define_project_tasks(
|
41
|
-
|
42
|
-
|
87
|
+
namespace: :circle_ci,
|
88
|
+
project_slug: 'github/infrablocks/rake_terraform'
|
43
89
|
) do |t|
|
44
90
|
circle_ci_config =
|
45
|
-
|
91
|
+
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
46
92
|
|
47
|
-
t.api_token = circle_ci_config[
|
93
|
+
t.api_token = circle_ci_config['circle_ci_api_token']
|
48
94
|
t.environment_variables = {
|
49
|
-
|
50
|
-
|
51
|
-
|
95
|
+
ENCRYPTION_PASSPHRASE:
|
96
|
+
File.read('config/secrets/ci/encryption.passphrase')
|
97
|
+
.chomp
|
52
98
|
}
|
53
99
|
t.checkout_keys = []
|
54
100
|
t.ssh_keys = [
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
101
|
+
{
|
102
|
+
hostname: 'github.com',
|
103
|
+
private_key: File.read('config/secrets/ci/ssh.private')
|
104
|
+
}
|
59
105
|
]
|
60
106
|
end
|
61
107
|
|
62
108
|
RakeGithub.define_repository_tasks(
|
63
|
-
|
64
|
-
|
109
|
+
namespace: :github,
|
110
|
+
repository: 'infrablocks/rake_terraform'
|
65
111
|
) do |t|
|
66
112
|
github_config =
|
67
|
-
|
113
|
+
YAML.load_file('config/secrets/github/config.yaml')
|
68
114
|
|
69
|
-
t.access_token = github_config[
|
115
|
+
t.access_token = github_config['github_personal_access_token']
|
70
116
|
t.deploy_keys = [
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
117
|
+
{
|
118
|
+
title: 'CircleCI',
|
119
|
+
public_key: File.read('config/secrets/ci/ssh.public')
|
120
|
+
}
|
75
121
|
]
|
76
122
|
end
|
77
123
|
|
78
124
|
namespace :pipeline do
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
125
|
+
desc 'Prepare CircleCI Pipeline'
|
126
|
+
task prepare: %i[
|
127
|
+
circle_ci:project:follow
|
128
|
+
circle_ci:env_vars:ensure
|
129
|
+
circle_ci:checkout_keys:ensure
|
130
|
+
circle_ci:ssh_keys:ensure
|
131
|
+
github:deploy_keys:ensure
|
85
132
|
]
|
86
133
|
end
|
87
134
|
|
88
135
|
namespace :version do
|
89
|
-
desc
|
136
|
+
desc 'Bump version for specified type (pre, major, minor, patch)'
|
90
137
|
task :bump, [:type] do |_, args|
|
91
138
|
bump_version_for(args.type)
|
92
139
|
end
|
93
140
|
end
|
94
141
|
|
95
|
-
desc
|
142
|
+
desc 'Release gem'
|
96
143
|
task :release do
|
97
|
-
sh
|
144
|
+
sh 'gem release --tag --push'
|
98
145
|
end
|
99
146
|
|
100
147
|
def bump_version_for(version_type)
|
101
|
-
sh "gem bump --version #{version_type} "
|
102
|
-
|
103
|
-
|
104
|
-
|
148
|
+
sh "gem bump --version #{version_type} " \
|
149
|
+
'&& bundle install ' \
|
150
|
+
'&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
|
151
|
+
'&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
|
105
152
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rake_terraform'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rake/terraform"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|