Class: Phase::CLI::Deploy

Inherits:
Command
  • Object
show all
Defined in:
lib/phase/cli/deploy.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#args, #options

Instance Method Summary collapse

Methods included from Util::Console

#ask, #fail, #log

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, options)
  super

  fail "Must specify 'instance_role' name" if args.first.blank?
  @instance_role  = args.first
end

Instance Attribute Details

#instance_roleObject (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

#runObject



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, options.number)
  deployment.execute!
end