aptible-cli 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6a4807415f02ddc44c0472480e3452ff0945d4a
4
- data.tar.gz: 7bc74d1f880230acbbec467bdb0c8802a8d3b8cb
3
+ metadata.gz: 4b9fd4e188e1528e1b563686014af146adb94682
4
+ data.tar.gz: 357b0531bc1e827cf48a9a6ed260b6d181d3da11
5
5
  SHA512:
6
- metadata.gz: c8477ebfa7cf401acdcc3e49d37e06a633489e6cbf44318f34d39bb2050e1e18452c965535964b6bc70b94c9ee9a4bcfe91131bb05c63db87ea32ddce021b309
7
- data.tar.gz: 3cc698ae24440386dc5063560eb4af84d295745d043f9888cbc8104a8f6f51470231ceaa26edffb780b5fcbbf8df6c3f22480b6e1497f6d1f9065536fd57bd9f
6
+ metadata.gz: c961a51996a5653d72ea6c43a34756e803442957e74b62d5e982bd8f9d198895243b259699f03fcbf0895b4b1c306d9d4baad5b392934735aaafd3d402474bd2
7
+ data.tar.gz: c5fece56955f0d3157661cb2a3219cdad0b69b0983fec6b360ae39f6647afec4eb5c3ea8d7ab694320c9c235cf0d2b5155380753549461935c9b09cd707fdeb8
data/README.md CHANGED
@@ -70,6 +70,7 @@ Commands:
70
70
  aptible ps # Display running processes for an app - DEPRECATED
71
71
  aptible rebuild # Rebuild an app, and restart its services
72
72
  aptible restart # Restart all services associated with an app
73
+ aptible services # List Services for an App
73
74
  aptible ssh [COMMAND] # Run a command against an app
74
75
  aptible version # Print Aptible CLI version
75
76
  ```
data/aptible-cli.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'aptible-api', '~> 1.0'
25
25
  spec.add_dependency 'aptible-auth', '~> 1.0'
26
26
  spec.add_dependency 'aptible-billing', '~> 1.0'
27
- spec.add_dependency 'thor', '~> 0.19.1'
27
+ spec.add_dependency 'thor', '~> 0.20.0'
28
28
  spec.add_dependency 'git'
29
29
  spec.add_dependency 'term-ansicolor'
30
30
  spec.add_dependency 'chronic_duration', '~> 0.10.6'
@@ -25,6 +25,7 @@ require_relative 'subcommands/ps'
25
25
  require_relative 'subcommands/rebuild'
26
26
  require_relative 'subcommands/deploy'
27
27
  require_relative 'subcommands/restart'
28
+ require_relative 'subcommands/services'
28
29
  require_relative 'subcommands/ssh'
29
30
  require_relative 'subcommands/backup'
30
31
  require_relative 'subcommands/operation'
@@ -47,6 +48,7 @@ module Aptible
47
48
  include Subcommands::Rebuild
48
49
  include Subcommands::Deploy
49
50
  include Subcommands::Restart
51
+ include Subcommands::Services
50
52
  include Subcommands::SSH
51
53
  include Subcommands::Backup
52
54
  include Subcommands::Operation
@@ -0,0 +1,30 @@
1
+ module Aptible
2
+ module CLI
3
+ module Subcommands
4
+ module Services
5
+ def self.included(thor)
6
+ thor.class_eval do
7
+ include Helpers::App
8
+
9
+ desc 'services', 'List Services for an App'
10
+ app_options
11
+ def services
12
+ app = ensure_app(options)
13
+
14
+ first = true
15
+ app.each_service do |service|
16
+ say '' unless first
17
+ first = false
18
+
19
+ say "Service: #{service.process_type}"
20
+ say "Command: #{service.command || 'CMD'}"
21
+ say "Container Count: #{service.container_count}"
22
+ say "Container Size: #{service.container_memory_limit_mb}"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.14.0'.freeze
3
+ VERSION = '0.14.1'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aptible::CLI::Agent do
4
+ let(:token) { double 'token' }
5
+ let(:app) { Fabricate(:app) }
6
+
7
+ let(:lines) { [] }
8
+
9
+ before do
10
+ allow(subject).to receive(:fetch_token) { token }
11
+ allow(Aptible::Api::App).to receive(:all).with(token: token)
12
+ .and_return([app])
13
+ allow(subject).to receive(:options).and_return(app: app.handle)
14
+
15
+ allow(subject).to receive(:say) { |m| lines << m }
16
+ end
17
+
18
+ it 'lists a CMD service' do
19
+ Fabricate(:service, app: app, process_type: 'cmd', command: nil)
20
+ subject.send('services')
21
+
22
+ expect(lines).to include('Service: cmd')
23
+ expect(lines).to include('Command: CMD')
24
+ end
25
+
26
+ it 'lists a service with command' do
27
+ Fabricate(:service, app: app, process_type: 'cmd', command: 'foobar')
28
+ subject.send('services')
29
+
30
+ expect(lines).to include('Service: cmd')
31
+ expect(lines).to include('Command: foobar')
32
+ end
33
+
34
+ it 'lists container size' do
35
+ Fabricate(:service, app: app, container_memory_limit_mb: 1024)
36
+ subject.send('services')
37
+
38
+ expect(lines).to include('Container Size: 1024')
39
+ end
40
+
41
+ it 'lists container count' do
42
+ Fabricate(:service, app: app, container_count: 3)
43
+ subject.send('services')
44
+
45
+ expect(lines).to include('Container Count: 3')
46
+ end
47
+
48
+ it 'lists multiple services' do
49
+ Fabricate(:service, app: app, process_type: 'foo')
50
+ Fabricate(:service, app: app, process_type: 'bar')
51
+ subject.send('services')
52
+
53
+ expect(lines).to include('Service: foo')
54
+ expect(lines).to include('Service: bar')
55
+ end
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-resource
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.19.1
81
+ version: 0.20.0
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.19.1
88
+ version: 0.20.0
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: git
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -270,6 +270,7 @@ files:
270
270
  - lib/aptible/cli/subcommands/ps.rb
271
271
  - lib/aptible/cli/subcommands/rebuild.rb
272
272
  - lib/aptible/cli/subcommands/restart.rb
273
+ - lib/aptible/cli/subcommands/services.rb
273
274
  - lib/aptible/cli/subcommands/ssh.rb
274
275
  - lib/aptible/cli/version.rb
275
276
  - script/sync-readme-usage
@@ -292,6 +293,7 @@ files:
292
293
  - spec/aptible/cli/subcommands/logs_spec.rb
293
294
  - spec/aptible/cli/subcommands/operation_spec.rb
294
295
  - spec/aptible/cli/subcommands/restart_spec.rb
296
+ - spec/aptible/cli/subcommands/services_spec.rb
295
297
  - spec/aptible/cli/subcommands/ssh_spec.rb
296
298
  - spec/fabricators/account_fabricator.rb
297
299
  - spec/fabricators/app_fabricator.rb
@@ -357,6 +359,7 @@ test_files:
357
359
  - spec/aptible/cli/subcommands/logs_spec.rb
358
360
  - spec/aptible/cli/subcommands/operation_spec.rb
359
361
  - spec/aptible/cli/subcommands/restart_spec.rb
362
+ - spec/aptible/cli/subcommands/services_spec.rb
360
363
  - spec/aptible/cli/subcommands/ssh_spec.rb
361
364
  - spec/fabricators/account_fabricator.rb
362
365
  - spec/fabricators/app_fabricator.rb