lib/shelly/cli/main.rb in shelly-0.1.21 vs lib/shelly/cli/main.rb in shelly-0.1.22
- old
+ new
@@ -18,11 +18,11 @@
register(Files, "files", "files <command>", "Upload and download files to and from persistent storage")
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, :logs, :delete, :info, :ip, :logout, :execute, :rake, :setup, :console]
+ before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop, :logs, :delete, :info, :ip, :logout, :execute, :rake, :setup, :console, :dbconsole]
before_hook :inside_git_repository?, :only => [:add, :setup, :check]
map %w(-v --version) => :version
desc "version", "Display shelly version"
def version
@@ -314,9 +314,18 @@
task = rake_args.join(" ")
app = multiple_clouds(options[:cloud], "rake #{task}")
app.rake(task)
rescue Client::ConflictException
say_error "Cloud #{app} is not running. Cannot run rake task."
+ end
+
+ desc "dbconsole", "Run rails dbconsole"
+ method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
+ def dbconsole(task = nil)
+ app = multiple_clouds(options[:cloud], "dbconsole")
+ app.dbconsole
+ rescue Client::ConflictException
+ say_error "Cloud #{app} is not running. Cannot run dbconsole."
end
desc "redeploy", "Redeploy application"
method_option :cloud, :type => :string, :aliases => "-c",
:desc => "Specify which cloud to redeploy application for"