ruby-terraform 0.61.0.pre.1 → 0.65.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +111 -32
- data/Rakefile +64 -36
- data/bin/console +3 -3
- data/lib/ruby-terraform.rb +1 -1
- data/lib/ruby_terraform.rb +1 -1
- data/lib/ruby_terraform/commands/apply.rb +0 -1
- data/lib/ruby_terraform/commands/base.rb +12 -14
- data/lib/ruby_terraform/commands/clean.rb +2 -2
- data/lib/ruby_terraform/commands/destroy.rb +0 -1
- data/lib/ruby_terraform/commands/format.rb +0 -1
- data/lib/ruby_terraform/commands/get.rb +1 -2
- data/lib/ruby_terraform/commands/import.rb +1 -1
- data/lib/ruby_terraform/commands/init.rb +0 -1
- data/lib/ruby_terraform/commands/output.rb +0 -1
- data/lib/ruby_terraform/commands/plan.rb +1 -1
- data/lib/ruby_terraform/commands/refresh.rb +1 -1
- data/lib/ruby_terraform/commands/remote_config.rb +1 -2
- data/lib/ruby_terraform/commands/show.rb +0 -1
- data/lib/ruby_terraform/commands/validate.rb +1 -1
- data/lib/ruby_terraform/commands/workspace.rb +1 -2
- data/lib/ruby_terraform/errors/execution_error.rb +1 -1
- data/lib/ruby_terraform/version.rb +1 -1
- metadata +111 -43
- data/.circleci/config.yml +0 -56
- data/.circleci/gpg.private.enc +0 -0
- data/.envrc +0 -5
- data/.git-crypt/.gitattributes +0 -4
- data/.git-crypt/keys/default/0/41D2606F66C3FF28874362B61A16916844CE9D82.gpg +0 -0
- data/.git-crypt/keys/default/0/AAE932B730C2BA697FFDFAE05DA390873E38358B.gpg +0 -0
- data/.gitattributes +0 -1
- data/.gitignore +0 -31
- data/.rspec +0 -2
- data/.ruby-version +0 -1
- data/CHANGELOG.md +0 -44
- data/TODO.md +0 -1
- data/config/secrets/.unlocked +0 -1
- data/config/secrets/ci/encryption.passphrase +0 -1
- data/config/secrets/ci/gpg.private +0 -58
- data/config/secrets/ci/gpg.public +0 -31
- data/config/secrets/ci/ssh.private +0 -51
- data/config/secrets/ci/ssh.public +0 -1
- data/config/secrets/circle_ci/config.yaml +0 -2
- data/config/secrets/github/config.yaml +0 -2
- data/config/secrets/rubygems/credentials +0 -2
- data/go +0 -56
- data/ruby_terraform.gemspec +0 -37
- data/scripts/ci/common/configure-git.sh +0 -8
- data/scripts/ci/common/configure-rubygems.sh +0 -16
- data/scripts/ci/common/install-git-crypt.sh +0 -8
- data/scripts/ci/common/install-gpg-key.sh +0 -19
- data/scripts/ci/steps/prerelease.sh +0 -16
- data/scripts/ci/steps/release.sh +0 -18
- data/scripts/ci/steps/test.sh +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dbba56077adf66c7e32da731ddb62cc90bfea3d2ba29ead63913edf3e1da5bd
|
4
|
+
data.tar.gz: 708c49c91c22e75dcc9262f3d7858d51015451ebfb56dd222bddcf37d95d0fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e0d2f034a80f3d3a3b08aaac13858ef88df3a7fcd16f41320c8aa79ea895cd11165ce8fe439568c46b906b85c54f6249a109899d50c1c4e1c4bd4a2b7356c4
|
7
|
+
data.tar.gz: a1e07bec999d28347645081e3d660c814f7e66a0d2c4f6079002a95e3ac021743904acc600a9a9f3965e8410b654c33381419110435cc0587cafad9acc93260a
|
data/Gemfile.lock
CHANGED
@@ -1,95 +1,174 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-terraform (0.
|
4
|
+
ruby-terraform (0.65.0.pre.2)
|
5
5
|
lino (>= 1.5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.
|
10
|
+
activesupport (6.1.3.1)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>=
|
13
|
-
minitest (
|
14
|
-
tzinfo (~>
|
15
|
-
zeitwerk (~> 2.
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
16
|
addressable (2.7.0)
|
17
17
|
public_suffix (>= 2.0.2, < 5.0)
|
18
|
+
ast (2.4.2)
|
19
|
+
coderay (1.1.3)
|
18
20
|
colored2 (3.1.2)
|
19
|
-
concurrent-ruby (1.1.
|
21
|
+
concurrent-ruby (1.1.8)
|
20
22
|
diff-lcs (1.4.4)
|
21
|
-
|
22
|
-
|
23
|
+
docile (1.3.5)
|
24
|
+
excon (0.79.0)
|
25
|
+
faker (2.17.0)
|
26
|
+
i18n (>= 1.6, < 2)
|
27
|
+
faraday (1.3.0)
|
28
|
+
faraday-net_http (~> 1.0)
|
23
29
|
multipart-post (>= 1.2, < 3)
|
24
30
|
ruby2_keywords
|
25
|
-
|
31
|
+
faraday-net_http (1.0.1)
|
32
|
+
ffi (1.15.0)
|
33
|
+
formatador (0.2.5)
|
34
|
+
gem-release (2.2.1)
|
35
|
+
guard (2.16.2)
|
36
|
+
formatador (>= 0.2.4)
|
37
|
+
listen (>= 2.7, < 4.0)
|
38
|
+
lumberjack (>= 1.0.12, < 2.0)
|
39
|
+
nenv (~> 0.1)
|
40
|
+
notiffany (~> 0.0)
|
41
|
+
pry (>= 0.9.12)
|
42
|
+
shellany (~> 0.0)
|
43
|
+
thor (>= 0.18.1)
|
44
|
+
guard-compat (1.2.1)
|
45
|
+
guard-rspec (4.7.3)
|
46
|
+
guard (~> 2.1)
|
47
|
+
guard-compat (~> 1.1)
|
48
|
+
rspec (>= 2.99.0, < 4.0)
|
26
49
|
hamster (3.0.0)
|
27
50
|
concurrent-ruby (~> 1.0)
|
28
|
-
i18n (1.8.
|
51
|
+
i18n (1.8.10)
|
29
52
|
concurrent-ruby (~> 1.0)
|
30
|
-
lino (1.
|
53
|
+
lino (1.9.0)
|
31
54
|
hamster (~> 3.0)
|
32
55
|
open4 (~> 1.3)
|
33
|
-
|
56
|
+
listen (3.5.1)
|
57
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
58
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
59
|
+
lumberjack (1.2.8)
|
60
|
+
method_source (1.0.0)
|
61
|
+
minitest (5.14.4)
|
34
62
|
multipart-post (2.1.1)
|
35
|
-
|
63
|
+
nenv (0.3.0)
|
64
|
+
notiffany (0.1.3)
|
65
|
+
nenv (~> 0.1)
|
66
|
+
shellany (~> 0.0)
|
67
|
+
octokit (4.20.0)
|
36
68
|
faraday (>= 0.9)
|
37
69
|
sawyer (~> 0.8.0, >= 0.5.3)
|
38
70
|
open4 (1.3.4)
|
71
|
+
parallel (1.20.1)
|
72
|
+
parser (3.0.0.0)
|
73
|
+
ast (~> 2.4.1)
|
74
|
+
pry (0.14.0)
|
75
|
+
coderay (~> 1.1)
|
76
|
+
method_source (~> 1.0)
|
39
77
|
public_suffix (4.0.6)
|
40
|
-
|
41
|
-
|
78
|
+
rainbow (3.0.0)
|
79
|
+
rake (13.0.3)
|
80
|
+
rake_circle_ci (0.9.0)
|
42
81
|
colored2 (~> 3.1)
|
43
82
|
excon (~> 0.72)
|
44
83
|
rake_factory (~> 0.23)
|
45
84
|
sshkey (~> 2.0)
|
46
|
-
rake_factory (0.
|
85
|
+
rake_factory (0.29.0)
|
47
86
|
activesupport (>= 4)
|
48
87
|
rake (~> 13.0)
|
49
|
-
rake_github (0.
|
88
|
+
rake_github (0.7.0)
|
50
89
|
colored2 (~> 3.1)
|
51
90
|
octokit (~> 4.16)
|
52
91
|
rake_factory (~> 0.23)
|
53
92
|
sshkey (~> 2.0)
|
54
|
-
|
93
|
+
rake_gpg (0.14.0)
|
94
|
+
rake_factory (>= 0.23, < 1)
|
95
|
+
ruby_gpg2 (>= 0.6, < 1)
|
96
|
+
rake_ssh (0.6.0)
|
55
97
|
colored2 (~> 3.1)
|
56
98
|
rake_factory (~> 0.23)
|
57
99
|
sshkey (~> 2.0)
|
100
|
+
rb-fsevent (0.10.4)
|
101
|
+
rb-inotify (0.10.1)
|
102
|
+
ffi (~> 1.0)
|
103
|
+
regexp_parser (2.1.1)
|
104
|
+
rexml (3.2.4)
|
58
105
|
rspec (3.10.0)
|
59
106
|
rspec-core (~> 3.10.0)
|
60
107
|
rspec-expectations (~> 3.10.0)
|
61
108
|
rspec-mocks (~> 3.10.0)
|
62
|
-
rspec-core (3.10.
|
109
|
+
rspec-core (3.10.1)
|
63
110
|
rspec-support (~> 3.10.0)
|
64
|
-
rspec-expectations (3.10.
|
111
|
+
rspec-expectations (3.10.1)
|
65
112
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
113
|
rspec-support (~> 3.10.0)
|
67
|
-
rspec-mocks (3.10.
|
114
|
+
rspec-mocks (3.10.2)
|
68
115
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
116
|
rspec-support (~> 3.10.0)
|
70
|
-
rspec-support (3.10.
|
71
|
-
|
117
|
+
rspec-support (3.10.2)
|
118
|
+
rubocop (1.12.0)
|
119
|
+
parallel (~> 1.10)
|
120
|
+
parser (>= 3.0.0.0)
|
121
|
+
rainbow (>= 2.2.2, < 4.0)
|
122
|
+
regexp_parser (>= 1.8, < 3.0)
|
123
|
+
rexml
|
124
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
125
|
+
ruby-progressbar (~> 1.7)
|
126
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
127
|
+
rubocop-ast (1.4.1)
|
128
|
+
parser (>= 2.7.1.5)
|
129
|
+
rubocop-rspec (2.2.0)
|
130
|
+
rubocop (~> 1.0)
|
131
|
+
rubocop-ast (>= 1.1.0)
|
132
|
+
ruby-progressbar (1.11.0)
|
133
|
+
ruby2_keywords (0.0.4)
|
134
|
+
ruby_gpg2 (0.8.0)
|
135
|
+
lino (>= 1.5)
|
72
136
|
sawyer (0.8.2)
|
73
137
|
addressable (>= 2.3.5)
|
74
138
|
faraday (> 0.8, < 2.0)
|
139
|
+
shellany (0.0.1)
|
140
|
+
simplecov (0.21.2)
|
141
|
+
docile (~> 1.1)
|
142
|
+
simplecov-html (~> 0.11)
|
143
|
+
simplecov_json_formatter (~> 0.1)
|
144
|
+
simplecov-html (0.12.3)
|
145
|
+
simplecov_json_formatter (0.1.2)
|
75
146
|
sshkey (2.0.0)
|
76
|
-
|
77
|
-
tzinfo (
|
78
|
-
|
79
|
-
|
147
|
+
thor (1.1.0)
|
148
|
+
tzinfo (2.0.4)
|
149
|
+
concurrent-ruby (~> 1.0)
|
150
|
+
unicode-display_width (2.0.0)
|
151
|
+
zeitwerk (2.4.2)
|
80
152
|
|
81
153
|
PLATFORMS
|
82
154
|
ruby
|
83
155
|
|
84
156
|
DEPENDENCIES
|
85
157
|
bundler (~> 2.0)
|
158
|
+
faker (~> 2.17)
|
86
159
|
gem-release (~> 2.1)
|
160
|
+
guard
|
161
|
+
guard-rspec
|
87
162
|
rake (~> 13.0)
|
88
|
-
rake_circle_ci (~> 0.
|
89
|
-
rake_github (~> 0.
|
90
|
-
|
163
|
+
rake_circle_ci (~> 0.9)
|
164
|
+
rake_github (~> 0.5)
|
165
|
+
rake_gpg (~> 0.12)
|
166
|
+
rake_ssh (~> 0.4)
|
91
167
|
rspec (~> 3.9)
|
168
|
+
rubocop
|
169
|
+
rubocop-rspec
|
92
170
|
ruby-terraform!
|
171
|
+
simplecov
|
93
172
|
|
94
173
|
BUNDLED WITH
|
95
|
-
2.
|
174
|
+
2.2.15
|
data/Rakefile
CHANGED
@@ -2,78 +2,106 @@ require 'yaml'
|
|
2
2
|
require 'rake_circle_ci'
|
3
3
|
require 'rake_github'
|
4
4
|
require 'rake_ssh'
|
5
|
+
require 'rake_gpg'
|
6
|
+
require 'securerandom'
|
5
7
|
require 'rspec/core/rake_task'
|
6
8
|
|
7
|
-
task :
|
9
|
+
task default: :spec
|
8
10
|
|
9
11
|
RSpec::Core::RakeTask.new(:spec)
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
)
|
13
|
+
namespace :encryption do
|
14
|
+
namespace :passphrase do
|
15
|
+
task :generate do
|
16
|
+
File.open('config/secrets/ci/encryption.passphrase', 'w') do |f|
|
17
|
+
f.write(SecureRandom.base64(36))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
namespace :keys do
|
24
|
+
namespace :deploy do
|
25
|
+
RakeSSH.define_key_tasks(
|
26
|
+
path: 'config/secrets/ci/',
|
27
|
+
comment: 'maintainers@infrablocks.io'
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
namespace :gpg do
|
32
|
+
RakeGPG.define_generate_key_task(
|
33
|
+
output_directory: 'config/secrets/ci',
|
34
|
+
name_prefix: 'gpg',
|
35
|
+
owner_name: 'InfraBlocks Maintainers',
|
36
|
+
owner_email: 'maintainers@infrablocks.io',
|
37
|
+
owner_comment: 'ruby_terraform CI Key'
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
16
41
|
|
17
42
|
RakeCircleCI.define_project_tasks(
|
18
|
-
|
19
|
-
|
43
|
+
namespace: :circle_ci,
|
44
|
+
project_slug: 'github/infrablocks/ruby_terraform'
|
20
45
|
) do |t|
|
21
46
|
circle_ci_config =
|
22
|
-
|
47
|
+
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
23
48
|
|
24
|
-
t.api_token = circle_ci_config[
|
49
|
+
t.api_token = circle_ci_config['circle_ci_api_token']
|
25
50
|
t.environment_variables = {
|
26
|
-
|
27
|
-
|
28
|
-
|
51
|
+
ENCRYPTION_PASSPHRASE:
|
52
|
+
File.read('config/secrets/ci/encryption.passphrase')
|
53
|
+
.chomp
|
29
54
|
}
|
55
|
+
t.checkout_keys = []
|
30
56
|
t.ssh_keys = [
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
57
|
+
{
|
58
|
+
hostname: 'github.com',
|
59
|
+
private_key: File.read('config/secrets/ci/ssh.private')
|
60
|
+
}
|
35
61
|
]
|
36
62
|
end
|
37
63
|
|
38
64
|
RakeGithub.define_repository_tasks(
|
39
|
-
|
40
|
-
|
65
|
+
namespace: :github,
|
66
|
+
repository: 'infrablocks/ruby_terraform'
|
41
67
|
) do |t|
|
42
68
|
github_config =
|
43
|
-
|
69
|
+
YAML.load_file('config/secrets/github/config.yaml')
|
44
70
|
|
45
|
-
t.access_token = github_config[
|
71
|
+
t.access_token = github_config['github_personal_access_token']
|
46
72
|
t.deploy_keys = [
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
73
|
+
{
|
74
|
+
title: 'CircleCI',
|
75
|
+
public_key: File.read('config/secrets/ci/ssh.public')
|
76
|
+
}
|
51
77
|
]
|
52
78
|
end
|
53
79
|
|
54
80
|
namespace :pipeline do
|
55
|
-
task :
|
56
|
-
|
57
|
-
|
58
|
-
|
81
|
+
task prepare: %i[
|
82
|
+
circle_ci:project:follow
|
83
|
+
circle_ci:env_vars:ensure
|
84
|
+
circle_ci:checkout_keys:ensure
|
85
|
+
circle_ci:ssh_keys:ensure
|
86
|
+
github:deploy_keys:ensure
|
59
87
|
]
|
60
88
|
end
|
61
89
|
|
62
90
|
namespace :version do
|
63
|
-
desc
|
91
|
+
desc 'Bump version for specified type (pre, major, minor, patch)'
|
64
92
|
task :bump, [:type] do |_, args|
|
65
93
|
bump_version_for(args.type)
|
66
94
|
end
|
67
95
|
end
|
68
96
|
|
69
|
-
desc
|
97
|
+
desc 'Release gem'
|
70
98
|
task :release do
|
71
|
-
sh
|
99
|
+
sh 'gem release --tag --push'
|
72
100
|
end
|
73
101
|
|
74
102
|
def bump_version_for(version_type)
|
75
|
-
sh "gem bump --version #{version_type} "
|
76
|
-
|
77
|
-
|
78
|
-
|
103
|
+
sh "gem bump --version #{version_type} " \
|
104
|
+
'&& bundle install ' \
|
105
|
+
'&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
|
106
|
+
'&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
|
79
107
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'ruby_terraform'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "ruby_terraform"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/lib/ruby-terraform.rb
CHANGED
data/lib/ruby_terraform.rb
CHANGED
@@ -5,7 +5,8 @@ module RubyTerraform
|
|
5
5
|
module Commands
|
6
6
|
class Base
|
7
7
|
def initialize(
|
8
|
-
|
8
|
+
binary: nil, logger: nil, stdin: nil, stdout: nil, stderr: nil
|
9
|
+
)
|
9
10
|
@binary = binary || RubyTerraform.configuration.binary
|
10
11
|
@logger = logger || RubyTerraform.configuration.logger
|
11
12
|
@stdin = stdin || RubyTerraform.configuration.stdin
|
@@ -18,12 +19,12 @@ module RubyTerraform
|
|
18
19
|
|
19
20
|
do_before(opts)
|
20
21
|
command = configure_command(builder, opts).build
|
21
|
-
logger.debug("Running '#{command
|
22
|
+
logger.debug("Running '#{command}'.")
|
22
23
|
|
23
24
|
command.execute(
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
stdin: stdin,
|
26
|
+
stdout: stdout,
|
27
|
+
stderr: stderr
|
27
28
|
)
|
28
29
|
do_after(opts)
|
29
30
|
rescue Open4::SpawnError
|
@@ -37,23 +38,20 @@ module RubyTerraform
|
|
37
38
|
attr_reader :binary, :logger, :stdin, :stdout, :stderr
|
38
39
|
|
39
40
|
def command_name
|
40
|
-
self.class.to_s.split(
|
41
|
+
self.class.to_s.split('::')[-1].downcase
|
41
42
|
end
|
42
43
|
|
43
44
|
def instantiate_builder
|
44
45
|
Lino::CommandLineBuilder
|
45
|
-
|
46
|
-
|
46
|
+
.for_command(binary)
|
47
|
+
.with_option_separator('=')
|
47
48
|
end
|
48
49
|
|
49
|
-
def do_before(opts)
|
50
|
-
end
|
50
|
+
def do_before(opts); end
|
51
51
|
|
52
|
-
def configure_command(builder, opts)
|
53
|
-
end
|
52
|
+
def configure_command(builder, opts); end
|
54
53
|
|
55
|
-
def do_after(opts)
|
56
|
-
end
|
54
|
+
def do_after(opts); end
|
57
55
|
end
|
58
56
|
end
|
59
57
|
end
|