Class: Sherpa::CLI::Deploy
- Inherits:
-
Object
- Object
- Sherpa::CLI::Deploy
- Defined in:
- lib/sherpa/cli/deploy.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(prompt = TTY::Prompt.new) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Constructor Details
#initialize(prompt = TTY::Prompt.new) ⇒ Deploy
Returns a new instance of Deploy.
6 7 8 |
# File 'lib/sherpa/cli/deploy.rb', line 6 def initialize(prompt = TTY::Prompt.new) @prompt = prompt end |
Class Method Details
.run ⇒ Object
10 11 12 |
# File 'lib/sherpa/cli/deploy.rb', line 10 def self.run new.run end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sherpa/cli/deploy.rb', line 14 def run self.trekker = trekker_prompt self.stage = prompt.select("Choose the stage!", stage_choices) self.branch = prompt.ask("What branch would you like to deploy?") deploy = Sherpa::Model::Deploy.new( trekker: trekker, stage: stage, branch: branch ) deploy.kick_off! prompt.ok("Deploying - #{branch} for #{`whoami`.chomp} to #{trekker.name} - #{stage.name}") rescue FailedRequest => e prompt.error("API Request Failed :(") end |