nexoform 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/nexoform +9 -1
- data/lib/nexoform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfb7b9a73c3539a07b5072c0cb8578070026159fd27d2309a6e253fa12252fa7
|
4
|
+
data.tar.gz: bfae58f03fcc3cc7a634f4afc365d54cca46530b97d3d6707b92926a3a7d87c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f17bc2e9a4b4341ee9f8ab5be0f7e6033d75a3691e58c49dea8498a9dac55b411c063ada6294e48060060427243314d086720d9d82c768f30261dcdcb87f310
|
7
|
+
data.tar.gz: c62b66ae199833afd1057c76086f8f667c33856f67a887876c6a7ab26c5724cc50b2c4dee25e9a0b26a0d730283ff9d63e15769868f818477e2d6e076432dce5
|
data/bin/nexoform
CHANGED
@@ -34,6 +34,7 @@ class NexoformBin < Thor
|
|
34
34
|
class_option :environment, type: :string, aliases: 'e', required: false
|
35
35
|
class_option :assume_yes, type: :boolean, aliases: 'y', default: false
|
36
36
|
class_option :refresh, type: :boolean, aliases: 'r', default: true
|
37
|
+
class_option :debug, type: :boolean, aliases: 'd', default: false
|
37
38
|
|
38
39
|
desc 'plan', 'Print out changes that will be made on next apply (runs a terraform plan)'
|
39
40
|
long_desc <<-LONGDESC
|
@@ -349,7 +350,8 @@ class NexoformBin < Thor
|
|
349
350
|
def terraform_apply(options)
|
350
351
|
varfile = apply_with_plan_file?(options) ? '' : var_file_arg(options)
|
351
352
|
planfile = apply_with_plan_file?(options) ? options[:plan] : ''
|
352
|
-
"
|
353
|
+
yes = options[:assume_yes] ? "yes 'yes' | " : ''
|
354
|
+
"#{yes}terraform apply #{varfile} #{planfile}"
|
353
355
|
end
|
354
356
|
|
355
357
|
def exec_output(options)
|
@@ -549,12 +551,15 @@ class NexoformBin < Thor
|
|
549
551
|
end
|
550
552
|
|
551
553
|
def process_dir(options, directory)
|
554
|
+
puts "[DEBUG]: Processing directory '#{directory}'" if options['debug']
|
552
555
|
Dir.chdir(directory) do
|
553
556
|
# Go through and process ERB into output then delete the ERB file
|
554
557
|
Dir.glob('*.erb').each do |f|
|
558
|
+
puts "Eval-ing ERB for file '#{f}'" if options['debug']
|
555
559
|
header = "# This file was generated by nexoform. Changes will be lost\n"
|
556
560
|
content = ERB.new(File.read(f), 0, "%<>").result(binding)
|
557
561
|
File.write(f.gsub(/\.erb$/i, ''), "#{header}#{content}")
|
562
|
+
puts "Removing ERB file '#{f}'" if options['debug']
|
558
563
|
FileUtils.rm([f])
|
559
564
|
end
|
560
565
|
|
@@ -620,5 +625,8 @@ else
|
|
620
625
|
rescue StandardError => e
|
621
626
|
puts "* Encountered an error. Make sure your config-file isn't messed up".red
|
622
627
|
puts "\n* Exception message: #{e.message}".yellow
|
628
|
+
if ARGV.any?{ |arg| arg =~ /debug/i }
|
629
|
+
puts e.backtrace.join("\n")
|
630
|
+
end
|
623
631
|
end
|
624
632
|
end
|
data/lib/nexoform/version.rb
CHANGED