class ThreeScaleToolbox::Commands::ProxyConfigCommand::DeploySubcommand

Public Class Methods

command() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 7
def self.command
  Cri::Command.define do
    name        'deploy'
    usage       'deploy <remote> <service>'
    summary     'Promotes the APIcast configuration to the Staging Environment'
    description 'Promotes the APIcast configuration to the Staging Environment (Production Environment in case of Service Mesh).'

    param :remote
    param :service_ref

    ThreeScaleToolbox::CLI.output_flag(self)

    runner DeploySubcommand
  end
end

Public Instance Methods

run() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 23
def run
  printer.print_record service.proxy_deploy
end

Private Instance Methods

find_service() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 37
def find_service
  Entities::Service.find(remote: remote,
                         ref: service_ref).tap do |svc|
    raise ThreeScaleToolbox::Error, "Service #{service_ref} does not exist" if svc.nil?
  end
end
printer() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 48
def printer
  options.fetch(:output, CLI::JsonPrinter.new)
end
remote() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 29
def remote
  @remote ||= threescale_client(arguments[:remote])
end
service() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 44
def service
  @service ||= find_service
end
service_ref() click to toggle source
# File lib/3scale_toolbox/commands/proxy_config_command/deploy_command.rb, line 33
def service_ref
  arguments[:service_ref]
end