Class: Phase::CLI::Deploy
Instance Attribute Summary collapse
-
#instance_role ⇒ Object
readonly
Returns the value of attribute instance_role.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(args, options) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Methods included from Util::Console
Constructor Details
#initialize(args, options) ⇒ Deploy
Returns a new instance of Deploy.
25 26 27 28 29 30 |
# File 'lib/phase/cli/deploy.rb', line 25 def initialize(args, ) super fail "Must specify 'instance_role' name" if args.first.blank? @instance_role = args.first end |
Instance Attribute Details
#instance_role ⇒ Object (readonly)
Returns the value of attribute instance_role.
23 24 25 |
# File 'lib/phase/cli/deploy.rb', line 23 def instance_role @instance_role end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/phase/cli/deploy.rb', line 32 def run # environment = config.deploy.environments.find { |e| e.name == instance_role } # fail "unknown environment: '#{instance_role}'" unless environment deployment = ::Phase::Deploy::Deployment.new(instance_role, .number) deployment.execute! end |