Class: Google::Cloud::Gemserver::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/google/cloud/gemserver/cli.rb,
lib/google/cloud/gemserver/cli/server.rb,
lib/google/cloud/gemserver/cli/project.rb,
lib/google/cloud/gemserver/cli/request.rb,
lib/google/cloud/gemserver/cli/cloud_sql.rb

Overview

CLI

The command line interface which provides methods to interact with a gemserver and deploy it to a given Google Cloud Platform project.

Defined Under Namespace

Classes: CloudSQL, Error, Project, Request, Server

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.start(args = ARGV) ⇒ Object



41
42
43
44
# File 'lib/google/cloud/gemserver/cli.rb', line 41

def self.start args = ARGV
  Configuration.new.gen_config
  super
end

Instance Method Details

#configObject

Displays the configuration used by the currently deployed gemserver.



146
147
# File 'lib/google/cloud/gemserver/cli.rb', line 146

desc "config", "Displays the config the current deployed gemserver is"\
" using (if one is running)"

#createObject

Creates a gemserver app and deploys it to a Google Cloud Platform project. An existing Google Cloud Platform project must be provided through the --use-proj option and an existing Cloud SQL instance may be provided through the --use-inst option, otherwise a new one will be created.



61
# File 'lib/google/cloud/gemserver/cli.rb', line 61

desc "create", "Creates and deploys the gem server then starts it"

#create_keyObject

Creates a key used for installing or pushing gems to the given gemserver with given permissions provided with the --permissions option. By default, a key with all permissions is created.



112
# File 'lib/google/cloud/gemserver/cli.rb', line 112

desc "create_key", "Creates an authentication key"

#deleteObject

Deletes a given gemserver provided by the --use-proj option. This deletes the Google Cloud Platform project, all associated Cloud SQL instances, and all Cloud Storage buckets.



100
# File 'lib/google/cloud/gemserver/cli.rb', line 100

desc "delete", "Delete a given gemserver"

#delete_keyObject

Deletes a given key provided by the --key option from the given gemserver.



130
# File 'lib/google/cloud/gemserver/cli.rb', line 130

desc "delete_key", "Deletes a given key"

#gen_configObject



168
169
170
# File 'lib/google/cloud/gemserver/cli.rb', line 168

def gen_config
  Configuration.new.gen_config
end

#prepareObject

Retrieves a Google Cloud Platform instance and informs the user to enable necessary APIs for that project. Also creates a Cloud SQL instance if one was not provided with the --use-inst option.



75
76
# File 'lib/google/cloud/gemserver/cli.rb', line 75

desc "prepare", "Uses a project on Google Cloud Platform and deploys"\
" a gemserver to it."

#startObject

Starts the gemserver by starting up gemstash.



48
49
50
# File 'lib/google/cloud/gemserver/cli.rb', line 48

desc "start", "Starts the gem server. This will be run automatically" \
" after a deploy. Running this locally will start the gemserver "\
"locally"

#statsObject

Displays statistics on the given gemserver such as private gems, cached gems, gemserver creation time, etc.



155
# File 'lib/google/cloud/gemserver/cli.rb', line 155

desc "stats", "Displays statistics on the given gemserver"

#updateObject

Updates the gemserver on Google Cloud Platform to the latest version of the gemserver installed on the user's system.



89
90
91
# File 'lib/google/cloud/gemserver/cli.rb', line 89

desc "update", "Redeploys the gemserver with the current config file" \
" and google-cloud-gemserver gem version (a deploy must have " \
"succeeded for 'update' to work."