aptible-cli 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ffdd3315dbbee4f94b8b02bb6c6695829c511cf950448997b603cce77253d20
4
- data.tar.gz: ac9983ee76d69580194e58d1f1acd6927f4addcbe2dbaec132ae133aa13d215a
3
+ metadata.gz: 17c44d3802245955af8e9e71f728cb1b78540440106df5b5510f98677276652a
4
+ data.tar.gz: 00ded45a48e4305d40bcb343242461c2c29738446a27f85479883ac1ca5e0052
5
5
  SHA512:
6
- metadata.gz: d4721d191f0f6c35f6f75717b1896a5ca44441e3d912cb9af23bcde319f9f7678881a7eaf14de89e3222834c139d8c8c7bbe3eb9239d980ec55d32b47acbd835
7
- data.tar.gz: 2ced7b764b4b1b0db0ed460a0afd3f14836054a15ec32d5681af077a6811743fddff655c3d27121abc6858729116d385eff2da2d0c807cbbcef3abf92b2b0183
6
+ metadata.gz: 5f9683895ba7b8b2f2586eae6dc6dbb0b2472817bbb341609521ab7bdac72cff61719341d0545f2c0164f0f204a2041bdd2fad12029f86beae6d83482df5b386
7
+ data.tar.gz: 81152b5c0b39dc12136ea7bfbdcd17c3ce3cc463582fa2f37bc4000fd715b5801c3fe21edb7ca32031fdac319406f4c64664f96f5a35ad0f15b2e05255f98933
@@ -43,6 +43,7 @@ module Aptible
43
43
  def inject_account(node, account)
44
44
  node.value('id', account.id)
45
45
  node.value('handle', account.handle)
46
+ node.value('created_at', account.created_at)
46
47
  end
47
48
 
48
49
  def inject_operation(node, operation)
@@ -56,6 +57,7 @@ module Aptible
56
57
  def inject_app(node, app, account)
57
58
  node.value('id', app.id)
58
59
  node.value('handle', app.handle)
60
+ node.value('created_at', app.created_at)
59
61
 
60
62
  node.value('status', app.status)
61
63
  node.value('git_remote', app.git_repo)
@@ -80,6 +82,7 @@ module Aptible
80
82
  def inject_database(node, database, account)
81
83
  node.value('id', database.id)
82
84
  node.value('handle', database.handle)
85
+ node.value('created_at', database.created_at)
83
86
 
84
87
  node.value('type', database.type)
85
88
  node.value('version', database.database_image.version)
@@ -120,6 +123,7 @@ module Aptible
120
123
  def inject_service(node, service, app)
121
124
  node.value('id', service.id)
122
125
  node.value('service', service.process_type)
126
+ node.value('created_at', service.created_at)
123
127
 
124
128
  node.value('command', service.command || 'CMD')
125
129
  node.value('container_count', service.container_count)
@@ -132,6 +136,7 @@ module Aptible
132
136
  node.value('id', vhost.id)
133
137
  node.value('hostname', vhost.external_host)
134
138
  node.value('status', vhost.status)
139
+ node.value('created_at', vhost.created_at)
135
140
 
136
141
  case vhost.type
137
142
  when 'tcp', 'tls'
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.18.0'.freeze
3
+ VERSION = '0.18.1'.freeze
4
4
  end
5
5
  end
@@ -27,6 +27,7 @@ describe Aptible::CLI::ResourceFormatter do
27
27
  'Id: 12',
28
28
  'Hostname: foo.io',
29
29
  'Status: provisioned',
30
+ "Created At: #{fmt_time(service.created_at)}",
30
31
  'Type: https',
31
32
  'Port: default',
32
33
  'Internal: false',
@@ -104,26 +104,30 @@ describe Aptible::CLI::Agent do
104
104
  {
105
105
  'environment' => {
106
106
  'id' => account.id,
107
- 'handle' => account.handle
107
+ 'handle' => account.handle,
108
+ 'created_at' => fmt_time(account.created_at)
108
109
  },
109
110
  'handle' => app.handle,
110
111
  'id' => app.id,
111
112
  'status' => app.status,
112
113
  'git_remote' => app.git_repo,
114
+ 'created_at' => fmt_time(app.created_at),
113
115
  'services' => [
114
116
  {
115
117
  'service' => s1.process_type,
116
118
  'id' => s1.id,
117
119
  'command' => s1.command,
118
120
  'container_count' => s1.container_count,
119
- 'container_size' => s1.container_memory_limit_mb
121
+ 'container_size' => s1.container_memory_limit_mb,
122
+ 'created_at' => fmt_time(s1.created_at)
120
123
  },
121
124
  {
122
125
  'service' => s2.process_type,
123
126
  'id' => s2.id,
124
127
  'command' => 'CMD',
125
128
  'container_count' => s2.container_count,
126
- 'container_size' => s2.container_memory_limit_mb
129
+ 'container_size' => s2.container_memory_limit_mb,
130
+ 'created_at' => fmt_time(s2.created_at)
127
131
  }
128
132
  ]
129
133
  }
@@ -145,12 +149,14 @@ describe Aptible::CLI::Agent do
145
149
  {
146
150
  'environment' => {
147
151
  'id' => account.id,
148
- 'handle' => account.handle
152
+ 'handle' => account.handle,
153
+ 'created_at' => fmt_time(account.created_at)
149
154
  },
150
155
  'handle' => app.handle,
151
156
  'id' => app.id,
152
157
  'status' => app.status,
153
158
  'git_remote' => app.git_repo,
159
+ 'created_at' => fmt_time(app.created_at),
154
160
  'last_deploy_operation' =>
155
161
  {
156
162
  'id' => op.id,
@@ -32,11 +32,13 @@ describe Aptible::CLI::Agent do
32
32
  expected_accounts = [
33
33
  {
34
34
  'handle' => 'foo',
35
- 'ca_body' => 'account 1 cert'
35
+ 'ca_body' => 'account 1 cert',
36
+ 'created_at' => fmt_time(a1.created_at)
36
37
  },
37
38
  {
38
39
  'handle' => 'bar',
39
- 'ca_body' => '--account 2 cert--'
40
+ 'ca_body' => '--account 2 cert--',
41
+ 'created_at' => fmt_time(a2.created_at)
40
42
  }
41
43
  ]
42
44
  expect(captured_output_json.map! { |account| account.except('id') })
@@ -26,4 +26,5 @@ Fabricator(:account, from: :stub_account) do
26
26
  apps { [] }
27
27
  databases { [] }
28
28
  certificates { [] }
29
+ created_at { Time.now }
29
30
  end
@@ -29,6 +29,7 @@ Fabricator(:app, from: :stub_app) do
29
29
  configurations { [] }
30
30
  current_configuration { nil }
31
31
  errors { Aptible::Resource::Errors.new }
32
+ created_at { Time.now }
32
33
 
33
34
  after_create { |app| app.account.apps << app }
34
35
  end
@@ -22,6 +22,7 @@ Fabricator(:database, from: :stub_database) do
22
22
 
23
23
  backups { [] }
24
24
  database_credentials { [] }
25
+ created_at { Time.now }
25
26
 
26
27
  after_create do |database, transients|
27
28
  database.account.databases << database
@@ -14,6 +14,7 @@ Fabricator(:service, from: :stub_service) do
14
14
  container_count { 1 }
15
15
  container_memory_limit_mb { 512 }
16
16
  vhosts { [] }
17
+ created_at { Time.now }
17
18
 
18
19
  after_create do |service, transients|
19
20
  if transients[:app]
@@ -7,6 +7,7 @@ Fabricator(:vhost, from: :stub_vhost) do
7
7
  virtual_domain { Fabricate.sequence(:virtual_domain) { |i| "domain#{i}" } }
8
8
  ip_whitelist { [] }
9
9
  container_ports { [] }
10
+ created_at { Time.now }
10
11
 
11
12
  after_create { |vhost| vhost.service.vhosts << vhost }
12
13
  end
data/spec/spec_helper.rb CHANGED
@@ -11,6 +11,10 @@ end
11
11
  # Require library up front
12
12
  require 'aptible/cli'
13
13
 
14
+ def fmt_time(time)
15
+ time.strftime('%Y-%m-%d %H:%M:%S %z')
16
+ end
17
+
14
18
  class SpecRenderer < Aptible::CLI::Renderer::Base
15
19
  def initialize
16
20
  @nodes = []
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.18.0
4
+ version: 0.18.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: 2021-06-01 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-resource