Class: Moonshot::Commands::Create
- Inherits:
-
Moonshot::Command
- Object
- Moonshot::Command
- Moonshot::Commands::Create
- Defined in:
- lib/moonshot/commands/create.rb
Instance Attribute Summary collapse
-
#deploy ⇒ Object
readonly
Returns the value of attribute deploy.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
Methods inherited from Moonshot::Command
Instance Attribute Details
#deploy ⇒ Object (readonly)
Returns the value of attribute deploy.
19 20 21 |
# File 'lib/moonshot/commands/create.rb', line 19 def deploy @deploy end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
19 20 21 |
# File 'lib/moonshot/commands/create.rb', line 19 def version @version end |
Instance Method Details
#execute ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/moonshot/commands/create.rb', line 40 def execute controller.create if @deploy && @version.nil? controller.push elsif @deploy controller.deploy_version(@version) end end |
#parser ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/moonshot/commands/create.rb', line 21 def parser @deploy = true parser = super desc = 'Choose if code should be deployed immediately after the stack is created' parser.on('-d', '--[no-]deploy', TrueClass, desc) do |v| @deploy = v end desc = 'Version for initial deployment. If unset, a new development build is created from the local directory' parser.on('--version VERSION_NAME', desc) do |v| @version = v end parser.on('--template-file=FILE', 'Override the path to the CloudFormation template.') do |v| Moonshot.config.template_file = v end end |