lib/terradactyl/cli.rb in terradactyl-0.15.1 vs lib/terradactyl/cli.rb in terradactyl-0.15.2
- old
+ new
@@ -74,12 +74,13 @@
if @stack.upgrade.zero?
print_ok "Upgraded: #{@stack.name}"
else
Stacks.error!(@stack)
print_crit "Failed to upgrade: #{@stack.name}"
+ throw :error
end
- rescue Terradactyl::Terraform::Commands::UnsupportedCommandError => e
+ rescue Terradactyl::Terraform::VersionManager::VersionManagerError => e
print_crit "Error: #{e.message}"
exit 1
end
end
# rubocop:enable Metrics/BlockLength
@@ -168,11 +169,11 @@
#################################################################
desc 'upgrade NAME', 'Cleans, inits, upgrades and formats an individual stack, by name'
def upgrade(name)
clean(name)
- init(name)
+ init(name, backend: false)
upgrade_stack(name)
fmt(name)
end
desc 'quickplan NAME', 'Clean, init and plan a stack, by name'
@@ -269,11 +270,13 @@
print_crit "Formatting failed: #{@stack.name}"
end
end
desc 'init NAME', 'Init an individual stack, by name'
- def init(name)
+ def init(name, backend: true)
@stack ||= Stack.new(name)
+ @stack.config.terraform.init.backend = backend
+
print_ok "Initializing: #{@stack.name}"
if @stack.init.zero?
print_ok "Initialized: #{@stack.name}"
else
Stacks.error!(@stack)