lib/shelly/cli/main.rb in shelly-0.3.2 vs lib/shelly/cli/main.rb in shelly-0.3.3
- old
+ new
@@ -22,11 +22,13 @@
register_subcommand(Logs, "logs", "logs <command>", "View application logs")
check_unknown_options!(:except => :rake)
# FIXME: it should be possible to pass single symbol, instead of one element array
- before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop, :delete, :info, :ip, :logout, :execute, :rake, :setup, :console, :dbconsole]
+ before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop,
+ :delete, :info, :ip, :logout, :execute, :rake, :setup, :console,
+ :dbconsole, :mongoconsole, :redis_cli]
before_hook :inside_git_repository?, :only => [:add, :setup, :check]
map %w(-v --version) => :version
desc "version", "Display shelly version"
def version
@@ -340,9 +342,27 @@
def dbconsole(task = nil)
app = multiple_clouds(options[:cloud], "dbconsole")
app.dbconsole
rescue Client::ConflictException
say_error "Cloud #{app} wasn't deployed properly. Can not run dbconsole."
+ end
+
+ desc "mongoconsole", "Run MongoDB console"
+ method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
+ def mongoconsole
+ app = multiple_clouds(options[:cloud], "mongoconsole")
+ app.mongoconsole
+ rescue Client::ConflictException
+ say_error "Cloud #{app} wasn't deployed properly. Can not run MongoDB console."
+ end
+
+ desc "redis-cli", "Run redis-cli"
+ method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
+ def redis_cli
+ app = multiple_clouds(options[:cloud], "redis-cli")
+ app.redis_cli
+ rescue Client::ConflictException
+ say_error "Cloud #{app} wasn't deployed properly. Can not run redis-cli."
end
desc "redeploy", "Redeploy application"
method_option :cloud, :type => :string, :aliases => "-c",
:desc => "Specify which cloud to redeploy application for"