Class: Sherpa::CLI
- Inherits:
-
Object
- Object
- Sherpa::CLI
- Defined in:
- lib/sherpa/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
5 6 7 |
# File 'lib/sherpa/cli.rb', line 5 def initialize @prompt = TTY::Prompt.new end |
Class Method Details
.run ⇒ Object
9 10 11 |
# File 'lib/sherpa/cli.rb', line 9 def self.run new.run end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sherpa/cli.rb', line 13 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 |