Class: ConfigKit::Cli::Deploy
- Defined in:
- lib/config_kit/cli/commands/deploy.rb
Instance Attribute Summary
Attributes inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
- #check_args ⇒ Object
-
#initialize(args) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Methods inherited from Command
Constructor Details
#initialize(args) ⇒ Deploy
Returns a new instance of Deploy.
5 6 7 8 9 10 |
# File 'lib/config_kit/cli/commands/deploy.rb', line 5 def initialize(args) @app = nil @version = nil super(args) check_args end |
Class Method Details
.command ⇒ Object
3 |
# File 'lib/config_kit/cli/commands/deploy.rb', line 3 def self.command; "deploy"; end |
Instance Method Details
#check_args ⇒ Object
12 13 14 15 |
# File 'lib/config_kit/cli/commands/deploy.rb', line 12 def check_args raise ConfigKit::Cli::Command::CommandFailure.new "Missing app parameters" if @app.nil? raise ConfigKit::Cli::Command::CommandFailure.new "Missing version parameters" if @version.nil? end |
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/config_kit/cli/commands/deploy.rb', line 17 def run begin ConfigKit.logger.debug "Run command #{self.class.command} with options #{@app}:#{@version}" @output = ConfigKit::Manager.deploy(@app, @version) pp @output.to_h.to_json rescue ConfigKit::Cli::Command::CommandFailure raise rescue => e ConfigKit.logger.error "Unexpected error attempting to get config data #{@uri} in env #{@env} for #{@app.nil? ? 'all' : @app}" ConfigKit.logger.debug "#{e}: #{e.backtrace.join("\n ")}" raise ConfigKit::Cli::Command::CommandFailure.new(e.to_s) end end |