Sha256: 2160bebbaab29975a7853c81a04a4e8a79a78cc28bcd55bf7f2b24c1b90316d8
Contents?: true
Size: 1.2 KB
Versions: 80
Compression:
Stored size: 1.2 KB
Contents
require_relative 'common' module Kontena::Cli::Apps class ScaleCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions include Common option ['-f', '--file'], 'FILE', 'Specify an alternate Kontena compose file', attribute_name: :filename, default: 'kontena.yml' option ['-p', '--project-name'], 'NAME', 'Specify an alternate project name (default: directory name)' parameter "SERVICE", "Service to show" parameter "INSTANCES", "Scales service to given number of instances" attr_reader :services def execute require_config_file(filename) yml_service = services_from_yaml(filename, [service], service_prefix, true) if yml_service[service] options = yml_service[service] exit_with_error("Service has already instances defined in #{filename}. Please update #{filename} and deploy service instead") if options['instances'] spinner "Scaling #{service.colorize(:cyan)} " do deployment = scale_service(require_token, prefixed_name(service), instances) wait_for_deploy_to_finish(token, deployment) end else exit_with_error("Service not found") end end end end
Version data entries
80 entries across 80 versions & 2 rubygems