lib/shuttle/runner.rb in shuttle-deploy-0.2.0.beta4 vs lib/shuttle/runner.rb in shuttle-deploy-0.2.0.beta5
- old
+ new
@@ -16,12 +16,16 @@
@config_path = config_path
@target = target
end
def load_config
- data = File.read(config_path)
+ data = File.read(config_path).strip
+ if data.empty?
+ raise ConfigError, "Configuration file is empty"
+ end
+
if config_path =~ /\.toml$/
parse_toml_data(data)
else
parse_yaml_data(data)
end
@@ -127,11 +131,13 @@
rescue Interrupt
STDERR.puts "Interrupted by user. Aborting deploy..."
exit_code = 1
rescue Exception => err
integration.cleanup_release
- integration.log("ERROR: #{err.message}", 'error')
+ integration.log("Shuttle ERROR: #{err.message}", 'error')
+ integration.log(err.backtrace.join("\n"), 'error')
+
exit_code = 1
ensure
integration.release_lock
end
@@ -148,10 +154,10 @@
raise ConfigError, "Invalid command: #{command}"
end
ssh.close
rescue Net::SSH::AuthenticationFailed
- STDERR.puts "Authentication failed"
+ STDERR.puts "SSH Authentication failed"
exit 1
end
end
end
\ No newline at end of file