dh-proteus 0.3.4 → 0.3.8

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: 10f66dcab397697c71838f79094e37d2222b1be3c9110bc31f3f6f07183fd5fa
4
- data.tar.gz: 462eac3c33ffab2f47a8fa0ed0e3e4669c38a88d2b63f3478cdf63d8a9d8e2db
3
+ metadata.gz: 525a435f4b60584612eb0cc1a07e2514551c269d7fa88116a86dceba62de1ee7
4
+ data.tar.gz: 8a374ee6e980024a09344ecf9be84cea570ce2c988b4869906d512ee0f999722
5
5
  SHA512:
6
- metadata.gz: add7493c81e4472bdadd9ce24aef06dcab1a3d56138ef653ad7eaa0a7fae5634c05fd8a8b551f450e6d22f36772e6bf4dc248b770a5898deccd9decfaeb9c30a
7
- data.tar.gz: 9c5d32885ab3977f1d51e2f2288abf0680842b9f9291df614a3cef4bf883008e9607ac446590c0744d41cb6fbd5047ce40bfe81e404e0b8a940e586d144169c4
6
+ metadata.gz: 46707896e8d6255d9e9ff5092875465ac35e963211fb300fe7aed971fef854043beeac0e7507c4f15dfed459b90c24ba48a341b95b13124e082fce0ae7c4308d
7
+ data.tar.gz: a76fbe51174cf4b04bdb36de05099336c71983b966f8bb2ecda3fcb7cacf0e5d32cd607e556bde4ed486870cf0c2e6ccf9d03992e8a6a0f4a16633c2bc4fbbfc
data/lib/proteus/app.rb CHANGED
@@ -23,7 +23,7 @@ module Proteus
23
23
  extend Proteus::ContextManagement::Helpers
24
24
 
25
25
  class_option :dryrun, type: :boolean, default: false, aliases: '-d'
26
- class_option :verbose, type: :boolean, default: false, aliases: '-v'
26
+ class_option :verbose, type: :boolean, default: true, aliases: '-v'
27
27
 
28
28
  contexts.each do |context|
29
29
 
@@ -10,6 +10,7 @@ module Proteus
10
10
  long_desc <<-LONGDESC
11
11
  Renders the module templates without running Terraform
12
12
  LONGDESC
13
+ option :init, type: :boolean, default: false
13
14
  def render
14
15
  render_backend
15
16
  module_manager = Proteus::Modules::Manager.new(context: context, environment: environment)
@@ -26,6 +27,8 @@ module Proteus
26
27
  suppress: true
27
28
  )
28
29
 
30
+ init(verbose: parent_options[:verbose]) if options[:init]
31
+
29
32
  say "Formatted files:", :green
30
33
  say fmt_output, :green
31
34
  end
@@ -0,0 +1,31 @@
1
+ module Proteus
2
+ module Commands
3
+ module Untaint
4
+ def self.included(thor_class)
5
+ thor_class.class_eval do
6
+
7
+ desc "untaint", "Untaints an existing resource"
8
+ long_desc <<-LONGDESC
9
+ Untaints an existing resource
10
+
11
+ --resource The resource to untaint
12
+ LONGDESC
13
+ option :resource, type: :string, aliases: "-r", required: true
14
+ def untaint
15
+ init(verbose: parent_options[:verbose])
16
+ confirm question: "Do you really want to run 'terraform untaint' on environment '#{environment}' in context '#{context}'?", color: :on_red, exit_code: 0 do
17
+
18
+ untaint_command = <<~UNTAINT_COMMAND
19
+ cd #{context_path(context)} && \
20
+ terraform untaint \
21
+ #{options[:resource]}
22
+ UNTAINT_COMMAND
23
+ syscall untaint_command.squeeze(' ')
24
+ end
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -7,6 +7,7 @@ require 'proteus/commands/output'
7
7
  require 'proteus/commands/plan'
8
8
  require 'proteus/commands/render'
9
9
  require 'proteus/commands/taint'
10
+ require 'proteus/commands/untaint'
10
11
 
11
12
  module Proteus
12
13
  class Common < Thor
@@ -54,8 +55,7 @@ module Proteus
54
55
  #{context_path(context)}
55
56
  TERRAFORM_COMMAND
56
57
 
57
- output = syscall terraform_command.squeeze(' '), suppress: true, capture: true
58
- say(output, :green) if verbose
58
+ syscall terraform_command.squeeze(' ')
59
59
  end
60
60
 
61
61
  def aws_profile
@@ -35,7 +35,9 @@ module Proteus
35
35
  if tfvars_content.empty?
36
36
  terraform_variables = []
37
37
  else
38
- terraform_variables = JSON.parse(parse_tfvars(tfvars: tfvars_content))
38
+ terraform_variables = JSON.parse(parse_tfvars(tfvars: tfvars_content)).merge({
39
+ 'proteus_environment' => @environment
40
+ })
39
41
  end
40
42
 
41
43
  @modules = []
@@ -1,5 +1,5 @@
1
1
  module Proteus
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.8"
3
3
  end
4
4
 
5
5
  if $0 == __FILE__
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dh-proteus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Albrecht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-25 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,6 +160,7 @@ files:
160
160
  - lib/proteus/commands/state/remove.rb
161
161
  - lib/proteus/commands/state/show.rb
162
162
  - lib/proteus/commands/taint.rb
163
+ - lib/proteus/commands/untaint.rb
163
164
  - lib/proteus/common.rb
164
165
  - lib/proteus/config/config.rb
165
166
  - lib/proteus/context_management/context.rb
@@ -214,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  - !ruby/object:Gem::Version
215
216
  version: '0'
216
217
  requirements: []
217
- rubygems_version: 3.2.3
218
+ rubygems_version: 3.2.15
218
219
  signing_key:
219
220
  specification_version: 4
220
221
  summary: Proteus is a Terraform wrapper application.