Class: Cloudspin::CLI
- Inherits:
-
Thor
- Object
- Thor
- Cloudspin::CLI
- Defined in:
- lib/cloudspin/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
126 127 128 |
# File 'lib/cloudspin/cli.rb', line 126 def self.exit_on_failure? true end |
Instance Method Details
#down ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cloudspin/cli.rb', line 60 def down puts terraform_runner.init_dry if [:'show-init'] if [:plan] && [:dry] puts terraform_runner.plan_dry(plan_destroy: true) elsif [:plan] && ! [:dry] instance.prepare puts terraform_runner.plan(plan_destroy: true) instance.after elsif ! [:plan] && [:dry] puts terraform_runner.down_dry else instance.prepare terraform_runner.down instance.after end end |
#info ⇒ Object
83 84 85 |
# File 'lib/cloudspin/cli.rb', line 83 def info puts "Configuration files: #{instance_configuration_files}" end |
#prepare ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/cloudspin/cli.rb', line 48 def prepare instance.prepare puts terraform_runner.init_dry if [:'show-init'] puts terraform_runner.init puts "Working folder prepared: #{instance.working_folder}" puts "Ready:\ncd #{instance.working_folder} && terraform apply" end |
#up ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cloudspin/cli.rb', line 29 def up puts terraform_runner.init_dry if [:'show-init'] if [:plan] && [:dry] puts terraform_runner.plan_dry elsif [:plan] && ! [:dry] instance.prepare puts terraform_runner.plan instance.after elsif ! [:plan] && [:dry] puts terraform_runner.up_dry else instance.prepare terraform_runner.up instance.after end end |