Class: Phase::CLI::Deploy
Instance Attribute Summary collapse
-
#env_name ⇒ Object
readonly
Returns the value of attribute env_name.
-
#version_number ⇒ Object
readonly
Returns the value of attribute version_number.
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.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/phase/cli/deploy.rb', line 20 def initialize(args, ) super fail "must specify both environment and version number" unless args.count >= 2 @env_name = args[0] @version_number = args[1] fail "must specify environment" unless env_name fail "must specify version number" unless version_number end |
Instance Attribute Details
#env_name ⇒ Object (readonly)
Returns the value of attribute env_name.
18 19 20 |
# File 'lib/phase/cli/deploy.rb', line 18 def env_name @env_name end |
#version_number ⇒ Object (readonly)
Returns the value of attribute version_number.
18 19 20 |
# File 'lib/phase/cli/deploy.rb', line 18 def version_number @version_number 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 == env_name } fail "unknown environment: '#{env_name}'" unless environment deployment = Deploy::Deployment.new(environment, version_tag: version_number) deployment.execute! end |