Skip to content

Commit

Permalink
add option to skip terraformstackmoduleoutputs hook using a file.
Browse files Browse the repository at this point in the history
  • Loading branch information
tbugfinder committed Jul 2, 2021
1 parent c5948f7 commit 7ae2d04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions hooks/createstackmoduleoutputs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# - ./test/fixtures/#{myEnv}/moduleoutputs.tf
# - ./test/integration/#{myEnv}/controls/blueprints.rb
# - ./test/integration/#{myEnv}/inspec.yml
# It exits silently without any processing if file ./.noterraformstackmoduleoutputs exists.
#

require 'json'
require 'open3'
Expand All @@ -35,6 +37,10 @@
tag: v1.50.5
MYYML

if File.exist?('./.noterraformstackmoduleoutputs')
exit! 0
end

INSPECYMLHEAD = if File.exist?(INSPECYMLTMPLFILE)
File.read(INSPECYMLTMPLFILE)
else
Expand Down Expand Up @@ -170,12 +176,6 @@
# pretty format modified tf files, so that a cyclic execution of terraform fmt is prohibited.
TFFMT = 'terraform fmt'
stdouttffmt, stderrtffmt, statustffmt = Open3.capture3(TFFMT)
pp stdouttffmt
pp stderrtffmt
pp statustffmt

TFFMTFIXTURES = "terraform fmt ./test/fixtures/#{myEnv}"
stdouttffmtfixtures, stderrtffmtfixtures, statustffmtfixtures = Open3.capture3(TFFMTFIXTURES)
pp stdouttffmtfixtures
pp stderrtffmtfixtures
pp statustffmtfixtures
2 changes: 1 addition & 1 deletion ods-pre-commit-hooks-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.required_ruby_version = '~> 2.6'
s.name = 'ods-pre-commit-hooks-ruby'
s.version = '0.0.7'
s.version = '0.0.8'

s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.authors = ['Josef Hartmann / Erhard Wais']
Expand Down

0 comments on commit 7ae2d04

Please sign in to comment.