terraspace_hooks 0.2.1 → 0.3.2

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: 95ad9290130a4da60d9d31e1d769274f939c2929904b7fb9fe597e74ec55b7ea
4
- data.tar.gz: d9a1439317ed5b81de0a5ec1867e6887cca137e4f95d138d90b475da59a6977d
3
+ metadata.gz: 4699c6d4fca3cfcec68a908f8acd96f933304a352c221adbbce47bc4abdb285b
4
+ data.tar.gz: abcd6b516c77d16cf76986462baf38528611df0b69d99fc1381bec6c6f20a996
5
5
  SHA512:
6
- metadata.gz: 793ba08df148c185c24450a0d6f23c72b6352a8a6843b94ea6cab68e11be2485acb0cc6652fdcfed87d18e5b37f9ebd7a80be0c4ebd5e75c11d1054572a26a22
7
- data.tar.gz: 9eab02f56b387d9ba2394861c8dae6c304f23d2c0bdd5479537866983e05dbb54f1e68c761a78b257630e1407da97d05234a532889cf40873a06833311dfa825
6
+ metadata.gz: 8c5e42eb618272843840eb36d81399818d61a9ecef34a5bd5803aeb6d472c1fe9a56332b40f5f74e6b3f0edcf7684d0b5c4389dc167fff4a27137f0a2e9dc5f5
7
+ data.tar.gz: 1cbb732d925f3bce6cc2836e0d9f67f3d5bea56db26a36feacdabb979a056dc6fd5144b2af6bc968374e7c682505c906a4655f954753bb908005cb17140c1d7f
@@ -5,6 +5,9 @@ module TerraspaceHooks
5
5
  class InfracostGenerator
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def call(runner)
8
+ return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
9
+ return if ENV['SKIP_TERRASPACE_HOOKS_INFRACOST_GENERATOR']
10
+
8
11
  raise 'Infracost not available' unless infracost_available?
9
12
  raise 'Terraform not available' unless terraform_available?
10
13
 
@@ -21,10 +24,7 @@ module TerraspaceHooks
21
24
  infracost output --path infracost_breakdown.json --format table --show-skipped
22
25
  COMMAND
23
26
 
24
- return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
25
- return if ENV['SKIP_TERRASPACE_HOOKS_INFRACOST_GENERATOR']
26
-
27
- system(command)
27
+ system(command, exception: true)
28
28
  end
29
29
  # rubocop:enable Metrics/MethodLength
30
30
 
@@ -5,6 +5,9 @@ module TerraspaceHooks
5
5
  class TfFmtValidator
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def call(runner)
8
+ return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
9
+ return if ENV['SKIP_TERRASPACE_HOOKS_TF_FMT_VALIDATOR']
10
+
8
11
  raise 'Terraform not available' unless terraform_available?
9
12
 
10
13
  mod = runner.mod
@@ -16,10 +19,7 @@ module TerraspaceHooks
16
19
  terraform fmt
17
20
  COMMAND
18
21
 
19
- return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
20
- return if ENV['SKIP_TERRASPACE_HOOKS_TF_FMT_VALIDATOR']
21
-
22
- system(command)
22
+ system(command, exception: true)
23
23
  end
24
24
  # rubocop:enable Metrics/MethodLength
25
25
 
@@ -5,6 +5,9 @@ module TerraspaceHooks
5
5
  class TfValidator
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def call(runner)
8
+ return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
9
+ return if ENV['SKIP_TERRASPACE_HOOKS_TF_VALIDATOR']
10
+
8
11
  raise 'Terraform not available' unless terraform_available?
9
12
 
10
13
  mod = runner.mod
@@ -16,10 +19,7 @@ module TerraspaceHooks
16
19
  terraform validate
17
20
  COMMAND
18
21
 
19
- return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
20
- return if ENV['SKIP_TERRASPACE_HOOKS_TF_VALIDATOR']
21
-
22
- system(command)
22
+ system(command, exception: true)
23
23
  end
24
24
  # rubocop:enable Metrics/MethodLength
25
25
 
@@ -5,6 +5,9 @@ module TerraspaceHooks
5
5
  class TflintValidator
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def call(runner)
8
+ return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
9
+ return if ENV['SKIP_TERRASPACE_HOOKS_TFLINT_VALIDATOR']
10
+
8
11
  raise 'Tflint not available' unless tflint_available?
9
12
 
10
13
  mod = runner.mod
@@ -16,10 +19,7 @@ module TerraspaceHooks
16
19
  tflint . --disable-rule=terraform_required_version --module
17
20
  COMMAND
18
21
 
19
- return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
20
- return if ENV['SKIP_TERRASPACE_HOOKS_TFLINT_VALIDATOR']
21
-
22
- system(command)
22
+ system(command, exception: true)
23
23
  end
24
24
  # rubocop:enable Metrics/MethodLength
25
25
 
@@ -5,6 +5,9 @@ module TerraspaceHooks
5
5
  class TfsecValidator
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def call(runner)
8
+ return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
9
+ return if ENV['SKIP_TERRASPACE_HOOKS_TFSEC_VALIDATOR']
10
+
8
11
  raise 'Tfsec not available' unless tfsec_available?
9
12
 
10
13
  mod = runner.mod
@@ -16,10 +19,7 @@ module TerraspaceHooks
16
19
  tfsec --concise-output
17
20
  COMMAND
18
21
 
19
- return if ENV['SKIP_TERRASPACE_HOOKS_ALL']
20
- return if ENV['SKIP_TERRASPACE_HOOKS_TFSEC_VALIDATOR']
21
-
22
- system(command)
22
+ system(command, exception: true)
23
23
  end
24
24
  # rubocop:enable Metrics/MethodLength
25
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerraspaceHooks
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace_hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - slamet kristanto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-23 00:00:00.000000000 Z
11
+ date: 2023-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.4.8
74
+ rubygems_version: 3.4.13
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Useful terraspace hook collection (infracost generator, tflint, tf validate)