lib/rmd/cli.rb in rmdd-0.1.0 vs lib/rmd/cli.rb in rmdd-0.1.1
- old
+ new
@@ -12,29 +12,27 @@
class << self
def load_config
fail(FileNotFound, 'Creds file not found. Ask DucLe for it') unless File.file?(CONFIG_PATH)
config = YAML.load_file(File.expand_path(CONFIG_PATH))
Configure.set(config)
- rescue FileNotFound => e
- $stdout.puts(e.message)
end
end
desc 'deploy', 'Deploy to a server'
method_option :server, aliases: '-s', desc: 'Server name', type: :string, required: true
def deploy
Cli.load_config
DeployService.deploy(options[:server])
- rescue ServerNotFound => e
+ rescue Exception => e
$stdout.puts(e.message)
end
desc 'restart', 'Restart a server. Please note that the latest image will be pulled to deploy to servers'
method_option :server, aliases: '-s', desc: 'Server name', type: :string, required: true
def restart
Cli.load_config
DeployService.restart(options[:server])
- rescue ServerNotFound => e
+ rescue Exception => e
$stdout.puts(e.message)
end
end
end