Sha256: 113e86561fba3fbe1f083ee4af20260772ac51530c2b21558db19bdb54cfa82f
Contents?: true
Size: 1.75 KB
Versions: 2
Compression:
Stored size: 1.75 KB
Contents
module Aptible module CLI module Subcommands module Apps def self.included(thor) thor.class_eval do include Helpers::Account include Helpers::Token desc 'apps', 'List all applications' option :account def apps scoped_accounts(options).each do |account| say "=== #{account.handle}" account.apps.each do |app| say app.handle end say '' end end desc 'apps:create HANDLE', 'Create a new application' option :account define_method 'apps:create' do |handle| account = ensure_account(options) app = account.create_app(handle: handle) if app.errors.any? fail Thor::Error, app.errors.full_messages.first else say "App #{handle} created!" end end desc 'apps:scale TYPE NUMBER', 'Scale app to NUMBER of instances' option :app define_method 'apps:scale' do |type, n| num = Integer(n) app = ensure_app(options) service = app.services.find { |s| s.process_type == type } op = service.create_operation(type: 'scale', container_count: num) attach_to_operation_logs(op) end option :app desc 'apps:deprovision', 'Deprovision an app' define_method 'apps:deprovision' do app = ensure_app(options) say "Deprovisioning #{app.handle}..." app.create_operation!(type: 'deprovision') end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aptible-cli-0.5.15 | lib/aptible/cli/subcommands/apps.rb |
aptible-cli-0.5.14 | lib/aptible/cli/subcommands/apps.rb |