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
121 122 123 |
# File 'lib/cloudspin/cli.rb', line 121 def self.exit_on_failure? true end |
Instance Method Details
#down ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cloudspin/cli.rb', line 58 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) elsif ! [:plan] && [:dry] puts terraform_runner.down_dry else instance.prepare terraform_runner.down end end |
#info ⇒ Object
79 80 81 |
# File 'lib/cloudspin/cli.rb', line 79 def info puts "Configuration files: #{instance_configuration_files}" end |
#prepare ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/cloudspin/cli.rb', line 46 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 |
# 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 elsif ! [:plan] && [:dry] puts terraform_runner.up_dry else instance.prepare terraform_runner.up end end |
#version ⇒ Object
74 75 76 |
# File 'lib/cloudspin/cli.rb', line 74 def version puts "cloudspin-stack: #{Cloudspin::Stack::VERSION}" end |