ruby-terraform 0.51.0.pre.2 → 0.51.0.pre.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cff48b117932b50d1b445d3b16a37667023415fc65e4b8ab2cf9f290cf79484c
4
- data.tar.gz: 4d95ede4e7f14a6cd9f450a6c09c00168329ae3b7ebcb4b83da5d5adc532647c
3
+ metadata.gz: b32c2fed8d63ca562c5ad4cbe2c18b00bbf19db4c4d5262bea6a290584772148
4
+ data.tar.gz: 11c94a94582af564921061abd45b3ec1c6f822e8b7bbb9be557866fa40cce1cc
5
5
  SHA512:
6
- metadata.gz: 19de637a5acaf2da3d7fdc88b010e12824084d45e264895a060b4005218cf7523c80cbed26bdcadde427fcff15f6883f80fabec5ade0f924523b404b4d0b33f9
7
- data.tar.gz: e3a1dc2a9381648e8383d1c815e9996786588c7722c08b2749bdf4a7e476763a6f2c6035303d20ccb8d587a2db3a6258de1991348de2b8062dc6f404a13f9b01
6
+ metadata.gz: 121d8804c41fa72ea5e183dda506a0474c4d168bd219e527a0489fd1ba8a2ff7e689865b46eb55eecbe41f96a07958fa2e27d932659661cd28974ebb2a1ca12e
7
+ data.tar.gz: de0297b0602f436d247aa9d48969bebc9d27c73119ad3699b8c58813976044c227d26a836f9feb57cd6c257f3c884e6efd476a4d0884c83b85462e90a37078b5
data/.circleci/config.yml CHANGED
@@ -1,16 +1,16 @@
1
1
  version: 2.1
2
2
  jobs:
3
3
  test:
4
- working_directory: ~/ruby-terraform
4
+ working_directory: ~/source
5
5
  docker:
6
- - image: ruby:2.4.7
6
+ - image: ruby:2.6.0
7
7
  steps:
8
8
  - checkout
9
9
  - run: ./scripts/ci/steps/test.sh
10
10
  prerelease:
11
- working_directory: ~/ruby-terraform
11
+ working_directory: ~/source
12
12
  docker:
13
- - image: ruby:2.4.7
13
+ - image: ruby:2.6.0
14
14
  steps:
15
15
  - checkout
16
16
  - run: ./scripts/ci/common/install-git-crypt.sh
@@ -19,9 +19,9 @@ jobs:
19
19
  - run: ./scripts/ci/common/configure-rubygems.sh
20
20
  - run: ./scripts/ci/steps/prerelease.sh
21
21
  release:
22
- working_directory: ~/ruby-terraform
22
+ working_directory: ~/source
23
23
  docker:
24
- - image: ruby:2.4.7
24
+ - image: ruby:2.6.0
25
25
  steps:
26
26
  - checkout
27
27
  - run: ./scripts/ci/common/install-git-crypt.sh
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.7
1
+ 2.6.0
data/Gemfile.lock CHANGED
@@ -1,39 +1,66 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (0.51.0.pre.2)
4
+ ruby-terraform (0.51.0.pre.3)
5
5
  lino (~> 1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ activesupport (6.0.2.2)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 0.7, < 2)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ zeitwerk (~> 2.2)
10
16
  addressable (2.7.0)
11
17
  public_suffix (>= 2.0.2, < 5.0)
18
+ colored2 (3.1.2)
12
19
  concurrent-ruby (1.1.6)
13
20
  diff-lcs (1.3)
14
- excon (0.72.0)
15
- faraday (1.0.0)
21
+ excon (0.73.0)
22
+ faraday (1.0.1)
16
23
  multipart-post (>= 1.2, < 3)
17
24
  gem-release (2.1.1)
18
25
  hamster (3.0.0)
19
26
  concurrent-ruby (~> 1.0)
27
+ i18n (1.8.2)
28
+ concurrent-ruby (~> 1.0)
20
29
  lino (1.1.0)
21
30
  hamster (~> 3.0)
22
31
  open4 (~> 1.3)
32
+ minitest (5.14.0)
23
33
  multipart-post (2.1.1)
24
- octokit (4.16.0)
34
+ octokit (4.18.0)
25
35
  faraday (>= 0.9)
26
36
  sawyer (~> 0.8.0, >= 0.5.3)
27
37
  open4 (1.3.4)
28
- public_suffix (4.0.3)
38
+ public_suffix (4.0.4)
29
39
  rake (13.0.1)
40
+ rake_circle_ci (0.7.0)
41
+ colored2 (~> 3.1)
42
+ excon (~> 0.72)
43
+ rake_factory (~> 0.23)
44
+ sshkey (~> 2.0)
45
+ rake_factory (0.27.0)
46
+ activesupport (>= 4)
47
+ rake (~> 13.0)
48
+ rake_github (0.5.0)
49
+ colored2 (~> 3.1)
50
+ octokit (~> 4.16)
51
+ rake_factory (~> 0.23)
52
+ sshkey (~> 2.0)
53
+ rake_ssh (0.4.0)
54
+ colored2 (~> 3.1)
55
+ rake_factory (~> 0.23)
56
+ sshkey (~> 2.0)
30
57
  rspec (3.9.0)
31
58
  rspec-core (~> 3.9.0)
32
59
  rspec-expectations (~> 3.9.0)
33
60
  rspec-mocks (~> 3.9.0)
34
61
  rspec-core (3.9.1)
35
62
  rspec-support (~> 3.9.1)
36
- rspec-expectations (3.9.0)
63
+ rspec-expectations (3.9.1)
37
64
  diff-lcs (>= 1.2.0, < 2.0)
38
65
  rspec-support (~> 3.9.0)
39
66
  rspec-mocks (3.9.1)
@@ -44,19 +71,23 @@ GEM
44
71
  addressable (>= 2.3.5)
45
72
  faraday (> 0.8, < 2.0)
46
73
  sshkey (2.0.0)
74
+ thread_safe (0.3.6)
75
+ tzinfo (1.2.7)
76
+ thread_safe (~> 0.1)
77
+ zeitwerk (2.3.0)
47
78
 
48
79
  PLATFORMS
49
80
  ruby
50
81
 
51
82
  DEPENDENCIES
52
83
  bundler (~> 2.0)
53
- excon (~> 0.72)
54
84
  gem-release (~> 2.1)
55
- octokit (~> 4.16)
56
85
  rake (~> 13.0)
86
+ rake_circle_ci (~> 0.3)
87
+ rake_github (~> 0.3)
88
+ rake_ssh (~> 0.2)
57
89
  rspec (~> 3.9)
58
90
  ruby-terraform!
59
- sshkey (~> 2.0)
60
91
 
61
92
  BUNDLED WITH
62
93
  2.1.4
data/README.md CHANGED
@@ -78,12 +78,12 @@ RubyTerraform.init
78
78
  RubyTerraform.init(from_module: 'some/module/path', path: 'infra/module')
79
79
  RubyTerraform::Commands::Init.new.execute
80
80
  RubyTerraform::Commands::Init.new.execute(
81
- from_module: 'some/module/path',
81
+ from_module: 'some/module/path',
82
82
  path: 'infra/module')
83
83
  ```
84
84
 
85
85
  The init command supports the following options passed as keyword arguments:
86
- * `from_module`: the source module to use to initialise; required if `path` is
86
+ * `from_module`: the source module to use to initialise; required if `path` is
87
87
  specified
88
88
  * `path`: the path to initialise.
89
89
  * `backend`: `true`/`false`, whether or not to configure the backend.
@@ -145,7 +145,7 @@ The plan command supports the following options passed as keyword arguments:
145
145
  * `state`: the path to the state file in which to store state; defaults to
146
146
  terraform.tfstate in the working directory or the remote state if configured.
147
147
  * `plan`: the name of the file in which to save the generated plan.
148
- * `input`: when `false`, will not ask for input for variables not directly set;
148
+ * `input`: when `false`, will not ask for input for variables not directly set;
149
149
  defaults to `true`.
150
150
  * `destroy`: when `true`, a plan will be generated to destroy all resources
151
151
  managed by the given configuration and state; defaults to `false`.
@@ -185,18 +185,18 @@ The apply command supports the following options passed as keyword arguments:
185
185
  * `state`: the path to the state file in which to store state; defaults to
186
186
  terraform.tfstate in the working directory or the remote state if configured.
187
187
  * `backup`: the path to the backup file in which to store the state backup.
188
- * `input`: when `false`, will not ask for input for variables not directly set;
188
+ * `input`: when `false`, will not ask for input for variables not directly set;
189
189
  defaults to `true`.
190
190
  * `no_backup`: when `true`, no backup file will be written; defaults to `false`.
191
191
  * `no_color`: whether or not the output from the command should be in color;
192
192
  defaults to `false`.
193
- * `auto_approve`: if `true`, the command applys without prompting the user to
193
+ * `auto_approve`: if `true`, the command applys without prompting the user to
194
194
  confirm the changes; defaults to `false`.
195
195
 
196
196
 
197
197
  ### RubyTerraform::Commands::Show
198
198
 
199
- The show command produces human-readable output from a state file or a plan
199
+ The show command produces human-readable output from a state file or a plan
200
200
  file. It can be called in the following ways:
201
201
 
202
202
  ```ruby
@@ -210,7 +210,7 @@ The show command supports the following options passed as keyword arguments:
210
210
  * `path`: the path to a state or plan file; required.
211
211
  * `no_color`: whether or not the output from the command should be in color;
212
212
  defaults to `false`.
213
- * `module_depth`: the depth of modules to show in the output; defaults to
213
+ * `module_depth`: the depth of modules to show in the output; defaults to
214
214
  showing all modules.
215
215
  * `json`: whether or not the output from the command should be in json format;
216
216
  defaults to `false`.
@@ -305,7 +305,7 @@ The refresh command supports the following options passed as keyword arguments:
305
305
  `targets` are provided, all targets will be passed to terraform.
306
306
  * `state`: the path to the state file in which to store state; defaults to
307
307
  terraform.tfstate in the working directory or the remote state if configured.
308
- * `input`: when `false`, will not ask for input for variables not directly set;
308
+ * `input`: when `false`, will not ask for input for variables not directly set;
309
309
  defaults to `true`.
310
310
  * `no_color`: whether or not the output from the command should be in color;
311
311
  defaults to `false`.
@@ -314,7 +314,7 @@ The refresh command supports the following options passed as keyword arguments:
314
314
  ### RubyTerraform::Commands::RemoteConfig
315
315
 
316
316
  The remote config command configures storage of state using a remote backend. It
317
- has been deprecated and since removed from terraform but is retained in this
317
+ has been deprecated and since removed from terraform but is retained in this
318
318
  library for backwards compatibility. It can be called in the following ways:
319
319
 
320
320
  ```ruby
@@ -372,12 +372,13 @@ The validate command supports the following options passed as keyword arguments:
372
372
  defaults to `false`.
373
373
  * `check_variables`: if `true`, the command checks whether all variables have
374
374
  been provided; defaults to `true`.
375
-
375
+ * `json`: whether or not the output from the command should be in json format;
376
+ defaults to `false`.
376
377
 
377
378
  ### RubyTerraform::Commands::Workspace
378
379
 
379
- The `workspace` command configures
380
- [Terraform Workspaces](https://www.terraform.io/docs/state/workspaces.html#using-workspaces).
380
+ The `workspace` command configures
381
+ [Terraform Workspaces](https://www.terraform.io/docs/state/workspaces.html#using-workspaces).
381
382
  It can be used as follows:
382
383
 
383
384
  ```ruby
@@ -390,7 +391,7 @@ RubyTerraform.workspace(operation: 'delete', workspace: 'staging')
390
391
  ```
391
392
 
392
393
  arguments:
393
- * `directory`: the directory containing terraform configuration, the default is
394
+ * `directory`: the directory containing terraform configuration, the default is
394
395
  the current path.
395
396
  * `operation`: `list`, `select`, `new` or `delete`. default `list`.
396
397
  * `workspace`: Workspace name.
@@ -398,10 +399,10 @@ arguments:
398
399
 
399
400
  ## Configuration
400
401
 
401
- In addition to configuring the location of the terraform binary, RubyTerraform
402
+ In addition to configuring the location of the terraform binary, RubyTerraform
402
403
  offers configuration of logging and standard streams. By default standard
403
- streams map to `$stdin`, `$stdout` and `$stderr` and all logging goes to
404
- `$stdout`.
404
+ streams map to `$stdin`, `$stdout` and `$stderr` and all logging goes to
405
+ `$stdout`.
405
406
 
406
407
  ### Logging
407
408
 
@@ -420,7 +421,7 @@ RubyTerraform.configure do |config|
420
421
  end
421
422
  ```
422
423
 
423
- RubyTerraform supports logging to multiple different outputs at once,
424
+ RubyTerraform supports logging to multiple different outputs at once,
424
425
  for example:
425
426
 
426
427
  ``` ruby
@@ -436,7 +437,7 @@ RubyTerraform.configure do |config|
436
437
  end
437
438
  ```
438
439
 
439
- Configured in this way, any logging performed by RubyTerraform will log to both
440
+ Configured in this way, any logging performed by RubyTerraform will log to both
440
441
  `STDOUT` and the provided `log_file`.
441
442
 
442
443
  ### Standard Streams
@@ -466,9 +467,9 @@ input = StringIO.new("user\ninput\n")
466
467
  RubyTerraform.configure do |config|
467
468
  config.stdin = input
468
469
  end
469
- ```
470
+ ```
470
471
 
471
- In this way, terraform can be driven by input from somewhere other than
472
+ In this way, terraform can be driven by input from somewhere other than
472
473
  interactive input from the terminal.
473
474
 
474
475
 
data/Rakefile CHANGED
@@ -1,132 +1,61 @@
1
- require 'sshkey'
2
- require 'octokit'
1
+ require 'yaml'
2
+ require 'rake_circle_ci'
3
+ require 'rake_github'
4
+ require 'rake_ssh'
3
5
  require 'rspec/core/rake_task'
4
6
 
5
- require_relative 'rake/circleci'
6
-
7
- RSpec::Core::RakeTask.new(:spec)
8
-
9
7
  task :default => :spec
10
8
 
11
- namespace :ssh_key do
12
- desc "Generate a new SSH key for CI"
13
- task :generate do
14
- print "Generating a new SSH key... "
15
- key = SSHKey.generate(
16
- type: "RSA",
17
- bits: 4096,
18
- comment: "maintainers@infrablocks.io")
19
- File.write('config/secrets/ci/ssh.private', key.private_key)
20
- File.write('config/secrets/ci/ssh.public', key.public_key)
21
- puts "Done."
22
- end
23
- end
24
-
25
- namespace :circle_ci do
26
- circle_ci_config_path = 'config/secrets/circle_ci/config.yaml'
27
-
28
- namespace :env_vars do
29
- desc "Destroy all environment variables from the CircleCI pipeline"
30
- task :destroy do
31
- print "Deleting all environment variables from pipeline... "
32
- circle_ci = CircleCI.new(circle_ci_config_path)
33
- circle_ci.delete_env_vars
34
- puts "Done."
35
- end
9
+ RSpec::Core::RakeTask.new(:spec)
36
10
 
37
- desc "Provision all environment variables to the CircleCI pipeline"
38
- task :provision do
39
- puts "Creating all environment variables in the pipeline... "
40
- env_vars = {
41
- 'ENCRYPTION_PASSPHRASE':
42
- File.read('config/secrets/ci/encryption.passphrase').chomp
11
+ RakeSSH.define_key_tasks(
12
+ namespace: :deploy_key,
13
+ path: 'config/secrets/ci/',
14
+ comment: 'maintainers@infrablocks.io'
15
+ )
16
+
17
+ RakeCircleCI.define_project_tasks(
18
+ namespace: :circle_ci,
19
+ project_slug: 'github/infrablocks/ruby_terraform'
20
+ ) do |t|
21
+ circle_ci_config =
22
+ YAML.load_file('config/secrets/circle_ci/config.yaml')
23
+
24
+ t.api_token = circle_ci_config["circle_ci_api_token"]
25
+ t.environment_variables = {
26
+ ENCRYPTION_PASSPHRASE:
27
+ File.read('config/secrets/ci/encryption.passphrase')
28
+ .chomp
29
+ }
30
+ t.ssh_keys = [
31
+ {
32
+ hostname: "github.com",
33
+ private_key: File.read('config/secrets/ci/ssh.private')
43
34
  }
44
-
45
- circle_ci = CircleCI.new(circle_ci_config_path)
46
- env_vars.each do |name, value|
47
- print "Creating environment variable: #{name}... "
48
- circle_ci.create_env_var(name, value)
49
- end
50
-
51
- puts "Done."
52
- end
53
-
54
- desc "Ensure all environment variables are configured on the CircleCI " +
55
- "pipeline"
56
- task :ensure => [:'destroy', :'provision']
57
- end
58
-
59
- namespace :ssh_key do
60
- desc "Destroy SSH key from the CircleCI pipeline"
61
- task :destroy do
62
- print "Destroying SSH key in the pipeline... "
63
- circle_ci = CircleCI.new(circle_ci_config_path)
64
- circle_ci.delete_ssh_keys
65
- puts "Done."
66
- end
67
-
68
- desc "Provision SSH key to the CircleCI pipeline"
69
- task :provision do
70
- print "Creating SSH key in the pipeline... "
71
- circle_ci = CircleCI.new(circle_ci_config_path)
72
- circle_ci.create_ssh_key(
73
- SSHKey.new(
74
- File.read('config/secrets/ci/ssh.private'),
75
- comment: 'github.com'))
76
- puts "Done."
77
- end
78
-
79
- desc "Ensure SSH key is configured on the CircleCI pipeline"
80
- task :ensure => [:'destroy', :'provision']
81
- end
35
+ ]
82
36
  end
83
37
 
84
- namespace :github do
85
- namespace :deploy_key do
86
- desc "Remove deploy key from the Github repository"
87
- task :destroy do
88
- print "Removing deploy key from the Github repository... "
89
- config = YAML.load_file('config/secrets/github/config.yaml')
90
- access_token = config["github_personal_access_token"]
91
- repo = config["github_repository"]
92
- client = Octokit::Client.new(access_token: access_token)
93
-
94
- deploy_keys = client.list_deploy_keys(repo)
95
- circle_ci_deploy_key = deploy_keys.find { |k| k[:title] == 'CircleCI' }
96
- if circle_ci_deploy_key
97
- client.remove_deploy_key(repo, circle_ci_deploy_key[:id])
98
- end
99
- puts "Done."
100
- end
101
-
102
- desc "Add deploy key to the Github repository"
103
- task :provision do
104
- print "Adding deploy key to the Github repository... "
105
- config = YAML.load_file('config/secrets/github/config.yaml')
106
- access_token = config["github_personal_access_token"]
107
- repo = config["github_repository"]
108
- client = Octokit::Client.new(access_token: access_token)
109
-
110
- ssh_key = SSHKey.new(
111
- File.read('config/secrets/ci/ssh.private'),
112
- comment: 'CircleCI')
113
- client.add_deploy_key(repo,
114
- ssh_key.comment,
115
- ssh_key.ssh_public_key,
116
- read_only: false)
117
- puts "Done."
118
- end
119
-
120
- desc "Ensure deploy key is configured on the Github repository"
121
- task :ensure => [:'destroy', :'provision']
122
- end
38
+ RakeGithub.define_repository_tasks(
39
+ namespace: :github,
40
+ repository: 'infrablocks/ruby_terraform',
41
+ ) do |t|
42
+ github_config =
43
+ YAML.load_file('config/secrets/github/config.yaml')
44
+
45
+ t.access_token = github_config["github_personal_access_token"]
46
+ t.deploy_keys = [
47
+ {
48
+ title: 'CircleCI',
49
+ public_key: File.read('config/secrets/ci/ssh.public')
50
+ }
51
+ ]
123
52
  end
124
53
 
125
54
  namespace :pipeline do
126
55
  task :prepare => [
127
56
  :'circle_ci:env_vars:ensure',
128
- :'circle_ci:ssh_key:ensure',
129
- :'github:deploy_key:ensure'
57
+ :'circle_ci:ssh_keys:ensure',
58
+ :'github:deploy_keys:ensure'
130
59
  ]
131
60
  end
132
61
 
@@ -1,51 +1,51 @@
1
1
  -----BEGIN RSA PRIVATE KEY-----
2
- MIIJKQIBAAKCAgEAlAor5NjXEpgtJfzyBHlYPMLQhactLFTZu3txw8y/jzvdpRC0
3
- pkCapzzf2pqG1Ig+MZRfhwoStBqz20TBk1+jwyjrlCBd9PzbNYVr1QUpib8X2fPo
4
- wrTVBSKEYB9TYgutzfi8Ze/On1stMrZ9Gf15xzZCyfOyHhUkm+ajS2beArmEA4Ox
5
- rQ0jO8tgRdvi7zbP/tdYRtyiFCZ2nfofuKpO8Br4pL1LBHz7I8PYuXH0qRDW4zeu
6
- AUFpyxFSBhzv8LnkifFUuuhk7TktM9JTDNRs0iuvBf5w1lJNOb6iLZ4C8thoNqE/
7
- 4V8GKvmpccorvQcRbjrvmIyz8g+TMYgBvi6Kf1QIlZBBj2AOxew1nSCTWKn4QpTy
8
- e8j2HUaC+2AuxjQwth6Tp969c/RAJq5zWCuLKR58TpdD2X3ODWWgYnucdTzchtVX
9
- sIWSwHAjSeRIj7U0b0g7dJL9JSaPLwev9tKzrx5Ju7XWh/xhBf7urEly+pCwYnpG
10
- wctNBsoWqtPdJuxP3tVAZTCico8gYM3/J6hOOCDlop4AGObtdsJSXaLu637+svzZ
11
- iPoOYdp5jmzJJ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AGdCgCxNcrOx+gqeJSTdWEOYiQ0taffoSidZZKcVjIJhtd4V8fxNZUalcsA17yjiVZujMIs0Wj+LUrj+96yO7BSHXrBV7p33dMzALnvgVHdPT6nFLiRqTBUuCZ8tUR/MIeVi9jJlHFNJxSWhOi7PtztVrrR78W8YgUrl4PvM5Efc5MqoR1oJef339w== maintainers@infrablocks.io
@@ -1,4 +1,2 @@
1
1
  ---
2
2
  circle_ci_api_token: "27393e98772c1342785957a776ca4acbaea7f7cb"
3
- circle_ci_base_url: "https://circleci.com/api"
4
- circle_ci_project_slug: "github/infrablocks/ruby_terraform"
@@ -1,3 +1,2 @@
1
1
  ---
2
2
  github_personal_access_token: "6deebdb15c371069618942f48acd76f35880ebb5"
3
- github_repository: "infrablocks/ruby_terraform"
@@ -12,6 +12,7 @@ module RubyTerraform
12
12
  state = opts[:state]
13
13
  check_variables = opts[:check_variables]
14
14
  no_color = opts[:no_color]
15
+ json_format = opts[:json]
15
16
 
16
17
  builder
17
18
  .with_subcommand('validate') do |sub|
@@ -28,6 +29,7 @@ module RubyTerraform
28
29
  sub = sub.with_option('-check-variables', check_variables) unless
29
30
  check_variables.nil?
30
31
  sub = sub.with_flag('-no-color') if no_color
32
+ sub = sub.with_flag('-json') if json_format
31
33
  sub
32
34
  end
33
35
  .with_argument(directory)
@@ -1,3 +1,3 @@
1
1
  module RubyTerraform
2
- VERSION = "0.51.0.pre.2"
2
+ VERSION = "0.51.0.pre.3"
3
3
  end
@@ -23,15 +23,15 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f)}
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.required_ruby_version = '>= 2.4.7'
26
+ spec.required_ruby_version = '>= 2.6'
27
27
 
28
28
  spec.add_dependency 'lino', '~> 1.1'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '~> 2.0'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
32
+ spec.add_development_dependency 'rake_circle_ci', '~> 0.3'
33
+ spec.add_development_dependency 'rake_github', '~> 0.3'
34
+ spec.add_development_dependency 'rake_ssh', '~> 0.2'
32
35
  spec.add_development_dependency 'rspec', '~> 3.9'
33
- spec.add_development_dependency 'excon', '~> 0.72'
34
- spec.add_development_dependency 'sshkey', '~> 2.0'
35
- spec.add_development_dependency 'octokit', '~> 4.16'
36
36
  spec.add_development_dependency 'gem-release', '~> 2.1'
37
37
  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.51.0.pre.2
4
+ version: 0.51.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-07 00:00:00.000000000 Z
11
+ date: 2020-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lino
@@ -53,61 +53,61 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: rake_circle_ci
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.9'
61
+ version: '0.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.9'
68
+ version: '0.3'
69
69
  - !ruby/object:Gem::Dependency
70
- name: excon
70
+ name: rake_github
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.72'
75
+ version: '0.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.72'
82
+ version: '0.3'
83
83
  - !ruby/object:Gem::Dependency
84
- name: sshkey
84
+ name: rake_ssh
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.0'
89
+ version: '0.2'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '2.0'
96
+ version: '0.2'
97
97
  - !ruby/object:Gem::Dependency
98
- name: octokit
98
+ name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '4.16'
103
+ version: '3.9'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '4.16'
110
+ version: '3.9'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: gem-release
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +178,6 @@ files:
178
178
  - lib/ruby_terraform/errors.rb
179
179
  - lib/ruby_terraform/errors/execution_error.rb
180
180
  - lib/ruby_terraform/version.rb
181
- - rake/circleci.rb
182
181
  - ruby_terraform.gemspec
183
182
  - scripts/ci/common/configure-git.sh
184
183
  - scripts/ci/common/configure-rubygems.sh
@@ -199,14 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
198
  requirements:
200
199
  - - ">="
201
200
  - !ruby/object:Gem::Version
202
- version: 2.4.7
201
+ version: '2.6'
203
202
  required_rubygems_version: !ruby/object:Gem::Requirement
204
203
  requirements:
205
204
  - - ">"
206
205
  - !ruby/object:Gem::Version
207
206
  version: 1.3.1
208
207
  requirements: []
209
- rubygems_version: 3.0.3
208
+ rubygems_version: 3.0.1
210
209
  signing_key:
211
210
  specification_version: 4
212
211
  summary: A simple Ruby wrapper for invoking Terraform commands.
data/rake/circleci.rb DELETED
@@ -1,114 +0,0 @@
1
- require 'rubygems'
2
- require 'excon'
3
- require 'yaml'
4
- require 'json'
5
-
6
- class CircleCI
7
- def initialize(config_path)
8
- config = YAML.load_file(config_path)
9
-
10
- @api_token = config["circle_ci_api_token"]
11
- @base_url = config["circle_ci_base_url"]
12
- @project_slug = config["circle_ci_project_slug"]
13
- end
14
-
15
- def find_env_vars
16
- response = assert_successful(Excon.get(env_vars_url, headers: headers))
17
- body = JSON.parse(response.body)
18
- env_vars = body["items"].map { |item| item["name"] }
19
-
20
- env_vars
21
- end
22
-
23
- def delete_env_var(name)
24
- assert_successful(Excon.delete(env_var_url(name), headers: headers))
25
- end
26
-
27
- def delete_env_vars
28
- env_vars = find_env_vars
29
- env_vars.each do |env_var|
30
- delete_env_var(env_var)
31
- end
32
- end
33
-
34
- def create_env_var(name, value)
35
- body = JSON.dump(name: name, value: value)
36
- assert_successful(
37
- Excon.post(env_vars_url, body: body, headers: headers))
38
- end
39
-
40
- def find_ssh_keys
41
- response = assert_successful(Excon.get(settings_url, headers: headers))
42
- body = JSON.parse(response.body)
43
- ssh_keys = body["ssh_keys"].map do |ssh_key|
44
- {
45
- fingerprint: ssh_key["fingerprint"],
46
- hostname: ssh_key["hostname"]
47
- }
48
- end
49
-
50
- ssh_keys
51
- end
52
-
53
- def delete_ssh_key(ssh_key_identifier)
54
- assert_successful(
55
- Excon.delete(ssh_keys_url,
56
- body: JSON.dump(ssh_key_identifier),
57
- headers: headers))
58
- end
59
-
60
- def delete_ssh_keys
61
- ssh_keys = find_ssh_keys
62
- ssh_keys.each do |ssh_key|
63
- delete_ssh_key(ssh_key)
64
- end
65
- end
66
-
67
- def create_ssh_key(ssh_key)
68
- body = JSON.dump({
69
- fingerprint: ssh_key.sha1_fingerprint,
70
- hostname: ssh_key.comment,
71
- private_key: ssh_key.private_key
72
- })
73
- assert_successful(
74
- Excon.post(ssh_keys_url, body: body, headers: headers))
75
- end
76
-
77
- private
78
-
79
- def headers
80
- {
81
- "Circle-Token": @api_token,
82
- "Content-Type": "application/json",
83
- "Accept": "application/json"
84
- }
85
- end
86
-
87
- def assert_successful(response)
88
- unless response.status >= 200 && response.status < 300
89
- host = response.data[:host]
90
- path = response.data[:path]
91
- status = response.status
92
- reason = response.data[:reason_phrase]
93
- raise "Unsuccessful request: #{host}#{path} #{status} #{reason}"
94
- end
95
- response
96
- end
97
-
98
- def env_vars_url
99
- "#{@base_url}/v2/project/#{@project_slug}/envvar"
100
- end
101
-
102
- def env_var_url(name)
103
- "#{@base_url}/v2/project/#{@project_slug}/envvar/#{name}"
104
- end
105
-
106
- def settings_url
107
- "#{@base_url}/v1.1/project/#{@project_slug}/settings"
108
- end
109
-
110
- def ssh_keys_url
111
- "#{@base_url}/v1.1/project/#{@project_slug}/ssh-key?" +
112
- "circle-token=#{@api_token}"
113
- end
114
- end