Class: Phase::CLI::Deploy
Instance Attribute Summary collapse
-
#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.
22 23 24 25 26 27 28 29 |
# File 'lib/phase/cli/deploy.rb', line 22 def initialize(args, ) super @version_number = args.first fail "must specify environment with '-e'" unless .env fail "must specify version number" unless version_number end |
Instance Attribute Details
#version_number ⇒ Object (readonly)
Returns the value of attribute version_number.
20 21 22 |
# File 'lib/phase/cli/deploy.rb', line 20 def version_number @version_number end |
Instance Method Details
#run ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/phase/cli/deploy.rb', line 31 def run opts = { version_tag: version_number } deployment = case .env when "sandbox" ::Phase::Deploy::SandboxDeployment.new(opts) when "staging" ::Phase::Deploy::StagingDeployment.new(opts) when "production" ::Phase::Deploy::ProductionDeployment.new(opts) else fail "unknown environment: '#{environment}'" end deployment.execute! end |