Class: Subspace::Cli
- Inherits:
-
Object
- Object
- Subspace::Cli
- Includes:
- Commander::Methods
- Defined in:
- lib/subspace/cli.rb
Instance Method Summary collapse
-
#run ⇒ Object
include whatever modules you need.
Instance Method Details
#run ⇒ Object
include whatever modules you need
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/subspace/cli.rb', line 20 def run program :name, 'subspace' program :version, Subspace::VERSION program :description, 'Ansible-backed server provisioning tool for rails' command :init do |c| c.syntax = 'subspace init [options]' c.summary = '' c.description = '' c.example 'description', 'command example' c.when_called Subspace::Commands::Init end command :bootstrap do |c| c.syntax = 'subspace boostrap [host]' c.summary = 'Install ansible requirements (python) and authorized_keys file' c.description = 'Ansible has very few dependencies, but python is one that is not installed by default on many linux images. The bootstrap command will install python on a host as well as copy the authorized_keys file. You will possibly need to type a password here.' c.option '--password', "Ask for a password instead of using ssh keys" c.option '--yum', "Use yum instead of apt to install python" c.when_called Subspace::Commands::Bootstrap end command :provision do |c| c.syntax = 'subspace provision [options]' c.summary = '' c.description = '' c.example 'description', 'command example' c.when_called Subspace::Commands::Provision end command :ssh do |c| c.syntax = 'subspace ssh [options]' c.summary = 'ssh to the remote server as the administrative user' c.description = '' c.when_called Subspace::Commands::Ssh end command :configure do |c, args| c.syntax = 'subspace configure' c.summary = "Regenerate all of the ansible configuration files. You don't normally need to run this." c.description = '' c.when_called Subspace::Commands::Configure end command :override do |c, args| c.syntax = 'subspace override [role]' c.summary = 'Override a role configuration by copying the configuration locally' c.description = 'Copies the default role configuration to config/provision/<role> where it can be modified.' c.when_called Subspace::Commands::Override end command :vars do |c, args| c.syntax = 'subspace vars [environment]' c.summary = 'View or edit the encrypted variables for an environment' c.description = '' c.option '--edit', "Edit the variables instead of view" c.when_called Subspace::Commands::Vars end run! end |