Class: EYCli::Command::CreateApp
- Defined in:
- lib/ey_cli/commands/create_app.rb
Defined Under Namespace
Classes: AppParser
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize ⇒ CreateApp
constructor
A new instance of CreateApp.
- #invoke ⇒ Object
- #options_parser ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ CreateApp
Returns a new instance of CreateApp.
4 5 6 7 8 |
# File 'lib/ey_cli/commands/create_app.rb', line 4 def initialize @accounts = EYCli::Controller::Accounts.new @apps = EYCli::Controller::Apps.new @envs = EYCli::Controller::Environments.new end |
Instance Method Details
#help ⇒ Object
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 |
# File 'lib/ey_cli/commands/create_app.rb', line 25 def help <<-EOF It takes its arguments(name, git repository and application type) from the base directory. Usage: ey_cli create_app Options: --account name Name of the account to add the application to. --name name Name of the app. --git uri Git repository uri. --type type Application type, either rack, rails2 or rails3. --env_name name Name of the environment to create. --framework_env env Type of the environment (production, staging...). --url url Domain name for the app. It accepts comma-separated values. --app_instances number Number of application instances. --db_instances number Number of database slaves. --solo A single instance for application and database. --stack App server stack, either passenger, unicorn or trinidad. --db_stack DB stack, valid options: mysql (for MySQL 5.0), mysql5_5 (for MySQL 5.5), postgresql or postgres9_1 (for PostgreSQL 9.1) --no_env Prevent to not create a default environment. --app_size Size of the app instances. --db_size Size of the db instances. EOF end |
#invoke ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ey_cli/commands/create_app.rb', line 10 def invoke account = @accounts.fetch_account(.delete(:account)) app = @apps.create(account, Dir.pwd, ) if app env_parser = CreateEnv::EnvParser.new.() if [:no_env] EYCli.term.say("Skipping creation of environment...") else environment = @envs.create(app, env_parser) EYCli.term.say("You can run now 'ey_cli show #{app.name}' to know the status of the application") end end app end |