aptible-cli 0.24.0 → 0.24.2
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 +4 -4
- data/.github/workflows/test.yml +15 -0
- data/Gemfile.lock +1 -1
- data/lib/aptible/cli/helpers/app.rb +1 -1
- data/lib/aptible/cli/helpers/environment.rb +11 -5
- data/lib/aptible/cli/helpers/operation.rb +11 -4
- data/lib/aptible/cli/helpers/vhost/option_set_builder.rb +1 -1
- data/lib/aptible/cli/resource_formatter.rb +1 -0
- data/lib/aptible/cli/subcommands/apps.rb +8 -6
- data/lib/aptible/cli/subcommands/backup.rb +6 -5
- data/lib/aptible/cli/subcommands/config.rb +1 -1
- data/lib/aptible/cli/subcommands/db.rb +14 -14
- data/lib/aptible/cli/subcommands/environment.rb +2 -2
- data/lib/aptible/cli/subcommands/log_drain.rb +3 -3
- data/lib/aptible/cli/subcommands/maintenance.rb +2 -2
- data/lib/aptible/cli/subcommands/metric_drain.rb +6 -6
- data/lib/aptible/cli/subcommands/services.rb +7 -0
- data/lib/aptible/cli/version.rb +1 -1
- data/spec/aptible/cli/subcommands/apps_spec.rb +6 -2
- data/spec/aptible/cli/subcommands/config_spec.rb +11 -0
- data/spec/aptible/cli/subcommands/operation_spec.rb +4 -2
- data/spec/aptible/cli/subcommands/services_spec.rb +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a86dab95f37f3e63919dd105b9eca70af63753165bfa6fb2436e626844831bdd
|
4
|
+
data.tar.gz: 01ee1b79365b6a8cbb1399843de3abbc7857e061c6b376ac57b355a55c34e8f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 404722114100e706aee73134ad66100f5ddeaf71417eea3b8ac065c493acd17f5a2464a0542233fc0fe20af3b26d4b0fc3598ac87b799396238cbf05bc559738
|
7
|
+
data.tar.gz: 2c3a6d45e49401f49ef01985a927f221c029c724ef79993388a42dded813989a57868636d4c4b313a6decb756255dbbb9bce08e67770a3ba7fea654ea18bf946
|
data/.github/workflows/test.yml
CHANGED
@@ -48,3 +48,18 @@ jobs:
|
|
48
48
|
contains(needs.*.result, 'failure')
|
49
49
|
|| contains(needs.*.result, 'cancelled')
|
50
50
|
}}
|
51
|
+
|
52
|
+
report-version:
|
53
|
+
runs-on: ubuntu-latest
|
54
|
+
if: github.ref == 'refs/heads/master'
|
55
|
+
steps:
|
56
|
+
- name: Report version
|
57
|
+
run: |
|
58
|
+
curl -sS -X POST -u "$ENFORCER_USERNAME:$ENFORCER_PASSWORD" \
|
59
|
+
-H "Content-Type: application/json" \
|
60
|
+
-d '{"name":"aptible-cli", "type":"client", "version": "${{ github.sha }}"}' \
|
61
|
+
"$ENFORCER_API/repo_version"
|
62
|
+
env:
|
63
|
+
ENFORCER_API: https://app-83237.aptible-test-leeroy.com
|
64
|
+
ENFORCER_USERNAME: aptible
|
65
|
+
ENFORCER_PASSWORD: ${{ secrets.ENFORCER_PASSWORD }}
|
data/Gemfile.lock
CHANGED
@@ -37,11 +37,17 @@ module Aptible
|
|
37
37
|
|
38
38
|
def ensure_default_environment
|
39
39
|
environments = Aptible::Api::Account.all(token: fetch_token)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
case environments.count
|
41
|
+
when 0
|
42
|
+
e = 'No environments. Go to https://app.aptible.com/ to proceed'
|
43
|
+
raise Thor::Error, e
|
44
|
+
when 1
|
45
|
+
return environments.first
|
46
|
+
else
|
47
|
+
raise Thor::Error, <<-ERR.gsub(/\s+/, ' ').strip
|
48
|
+
Multiple environments available, please specify with --environment or --env
|
49
|
+
ERR
|
50
|
+
end
|
45
51
|
end
|
46
52
|
end
|
47
53
|
end
|
@@ -38,8 +38,10 @@ module Aptible
|
|
38
38
|
# operation failed, poll_for_success will immediately fall through to
|
39
39
|
# the error message.
|
40
40
|
unless code == 0
|
41
|
-
|
42
|
-
|
41
|
+
msg = ['Disconnected from logs, waiting for operation to complete',
|
42
|
+
'Once complete, the logs can be viewed here:',
|
43
|
+
" #{ui_log_url(operation)}"]
|
44
|
+
msg.each { |e| CLI.logger.warn e }
|
43
45
|
poll_for_success(operation)
|
44
46
|
end
|
45
47
|
end
|
@@ -76,8 +78,9 @@ module Aptible
|
|
76
78
|
res = http.request(Net::HTTP::Get.new(uri.request_uri, headers))
|
77
79
|
# note: res body with a 200 is target redirect location for download
|
78
80
|
if !res || res.code != '200' || res.body.nil?
|
79
|
-
raise Thor::Error, 'Unable to retrieve the operation\'s logs. '\
|
80
|
-
'If the issue persists please contact support for assistance
|
81
|
+
raise Thor::Error, 'Unable to retrieve the operation\'s logs. ' \
|
82
|
+
'If the issue persists please contact support for assistance, or ' \
|
83
|
+
"view them at #{ui_log_url(operation)}"
|
81
84
|
end
|
82
85
|
res
|
83
86
|
end
|
@@ -96,6 +99,10 @@ module Aptible
|
|
96
99
|
end
|
97
100
|
res
|
98
101
|
end
|
102
|
+
|
103
|
+
def ui_log_url(operation)
|
104
|
+
"https://app.aptible.com/operations/#{operation.id}"
|
105
|
+
end
|
99
106
|
end
|
100
107
|
end
|
101
108
|
end
|
@@ -157,6 +157,7 @@ module Aptible
|
|
157
157
|
node.value('command', service.command || 'CMD')
|
158
158
|
node.value('container_count', service.container_count)
|
159
159
|
node.value('container_size', service.container_memory_limit_mb)
|
160
|
+
node.value('container_profile', service.instance_class.to_s[/[a-z]/])
|
160
161
|
|
161
162
|
attach_app(node, app)
|
162
163
|
end
|
@@ -9,7 +9,7 @@ module Aptible
|
|
9
9
|
include Helpers::Token
|
10
10
|
|
11
11
|
desc 'apps', 'List all applications'
|
12
|
-
option :environment
|
12
|
+
option :environment, aliases: '--env'
|
13
13
|
def apps
|
14
14
|
Formatter.render(Renderer.current) do |root|
|
15
15
|
root.grouped_keyed_list(
|
@@ -28,7 +28,7 @@ module Aptible
|
|
28
28
|
end
|
29
29
|
|
30
30
|
desc 'apps:create HANDLE', 'Create a new application'
|
31
|
-
option :environment
|
31
|
+
option :environment, aliases: '--env'
|
32
32
|
define_method 'apps:create' do |handle|
|
33
33
|
environment = ensure_environment(options)
|
34
34
|
app = environment.create_app(handle: handle)
|
@@ -69,9 +69,11 @@ module Aptible
|
|
69
69
|
raise Thor::Error, m
|
70
70
|
end
|
71
71
|
|
72
|
-
if container_count.nil? && container_size.nil?
|
73
|
-
|
74
|
-
|
72
|
+
if container_count.nil? && container_size.nil? &&
|
73
|
+
container_profile.nil?
|
74
|
+
m = 'Provide at least --container-count, --container-size, ' \
|
75
|
+
'or --container-profile'
|
76
|
+
raise Thor::Error, m
|
75
77
|
end
|
76
78
|
|
77
79
|
# We don't validate any parameters here: API will do that for us.
|
@@ -104,7 +106,7 @@ module Aptible
|
|
104
106
|
' ENVIRONMENT_HANDLE]', 'Rename an app handle. In order'\
|
105
107
|
' for the new app handle to appear in log drain and metric'\
|
106
108
|
' drain destinations, you must restart the app.'
|
107
|
-
option :environment
|
109
|
+
option :environment, aliases: '--env'
|
108
110
|
define_method 'apps:rename' do |old_handle, new_handle|
|
109
111
|
env = ensure_environment(options)
|
110
112
|
app = ensure_app(options.merge(app: old_handle))
|
@@ -14,7 +14,8 @@ module Aptible
|
|
14
14
|
'[--key-arn KEY_ARN]',
|
15
15
|
'Restore a backup'
|
16
16
|
option :handle, desc: 'a name to use for the new database'
|
17
|
-
option :environment,
|
17
|
+
option :environment, aliases: '--env',
|
18
|
+
desc: 'a different environment to restore to'
|
18
19
|
option :container_size, type: :numeric
|
19
20
|
option :size, type: :numeric
|
20
21
|
option :disk_size, type: :numeric
|
@@ -68,9 +69,9 @@ module Aptible
|
|
68
69
|
end
|
69
70
|
|
70
71
|
desc 'backup:list DB_HANDLE', 'List backups for a database'
|
71
|
-
option :environment
|
72
|
+
option :environment, aliases: '--env'
|
72
73
|
option :max_age,
|
73
|
-
default: '
|
74
|
+
default: '99y',
|
74
75
|
desc: 'Limit backups returned (example usage: 1w, 1y, etc.)'
|
75
76
|
define_method 'backup:list' do |handle|
|
76
77
|
age = ChronicDuration.parse(options[:max_age])
|
@@ -95,8 +96,8 @@ module Aptible
|
|
95
96
|
|
96
97
|
desc 'backup:orphaned', 'List backups associated with ' \
|
97
98
|
'deprovisioned databases'
|
98
|
-
option :environment
|
99
|
-
option :max_age, default: '
|
99
|
+
option :environment, aliases: '--env'
|
100
|
+
option :max_age, default: '99y',
|
100
101
|
desc: 'Limit backups returned '\
|
101
102
|
'(example usage: 1w, 1y, etc.)'
|
102
103
|
define_method 'backup:orphaned' do
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'shellwords'
|
2
|
-
|
3
2
|
module Aptible
|
4
3
|
module CLI
|
5
4
|
module Subcommands
|
@@ -72,6 +71,7 @@ module Aptible
|
|
72
71
|
# FIXME: define_method - ?! Seriously, WTF Thor.
|
73
72
|
app = ensure_app(options)
|
74
73
|
env = Hash[args.map do |arg|
|
74
|
+
arg = arg.split('=')[0]
|
75
75
|
validate_env_key!(arg)
|
76
76
|
[arg, '']
|
77
77
|
end]
|
@@ -14,7 +14,7 @@ module Aptible
|
|
14
14
|
include Term::ANSIColor
|
15
15
|
|
16
16
|
desc 'db:list', 'List all databases'
|
17
|
-
option :environment
|
17
|
+
option :environment, aliases: '--env'
|
18
18
|
define_method 'db:list' do
|
19
19
|
Formatter.render(Renderer.current) do |root|
|
20
20
|
root.grouped_keyed_list(
|
@@ -63,7 +63,7 @@ module Aptible
|
|
63
63
|
option :disk_size, default: 10, type: :numeric
|
64
64
|
option :size, type: :numeric
|
65
65
|
option :key_arn, type: :string
|
66
|
-
option :environment
|
66
|
+
option :environment, aliases: '--env'
|
67
67
|
option :container_profile, type: :string,
|
68
68
|
desc: 'Examples: m c r'
|
69
69
|
option :iops, type: :numeric
|
@@ -126,7 +126,7 @@ module Aptible
|
|
126
126
|
end
|
127
127
|
|
128
128
|
desc 'db:clone SOURCE DEST', 'Clone a database to create a new one'
|
129
|
-
option :environment
|
129
|
+
option :environment, aliases: '--env'
|
130
130
|
define_method 'db:clone' do |source_handle, dest_handle|
|
131
131
|
# TODO: Deprecate + recommend backup
|
132
132
|
source = ensure_database(options.merge(db: source_handle))
|
@@ -139,7 +139,7 @@ module Aptible
|
|
139
139
|
'[--container-profile PROFILE] [--iops IOPS] ' \
|
140
140
|
'[--logical --version VERSION] [--key-arn KEY_ARN]',
|
141
141
|
'Create a replica/follower of a database'
|
142
|
-
option :environment
|
142
|
+
option :environment, aliases: '--env'
|
143
143
|
option :container_size, type: :numeric
|
144
144
|
option :size, type: :numeric
|
145
145
|
option :disk_size, type: :numeric
|
@@ -191,7 +191,7 @@ module Aptible
|
|
191
191
|
|
192
192
|
desc 'db:dump HANDLE [pg_dump options]',
|
193
193
|
'Dump a remote database to file'
|
194
|
-
option :environment
|
194
|
+
option :environment, aliases: '--env'
|
195
195
|
define_method 'db:dump' do |handle, *dump_options|
|
196
196
|
database = ensure_database(options.merge(db: handle))
|
197
197
|
with_postgres_tunnel(database) do |url|
|
@@ -204,7 +204,7 @@ module Aptible
|
|
204
204
|
|
205
205
|
desc 'db:execute HANDLE SQL_FILE [--on-error-stop]',
|
206
206
|
'Executes sql against a database'
|
207
|
-
option :environment
|
207
|
+
option :environment, aliases: '--env'
|
208
208
|
option :on_error_stop, type: :boolean
|
209
209
|
define_method 'db:execute' do |handle, sql_path|
|
210
210
|
database = ensure_database(options.merge(db: handle))
|
@@ -217,7 +217,7 @@ module Aptible
|
|
217
217
|
end
|
218
218
|
|
219
219
|
desc 'db:tunnel HANDLE', 'Create a local tunnel to a database'
|
220
|
-
option :environment
|
220
|
+
option :environment, aliases: '--env'
|
221
221
|
option :port, type: :numeric
|
222
222
|
option :type, type: :string
|
223
223
|
define_method 'db:tunnel' do |handle|
|
@@ -262,7 +262,7 @@ module Aptible
|
|
262
262
|
end
|
263
263
|
|
264
264
|
desc 'db:deprovision HANDLE', 'Deprovision a database'
|
265
|
-
option :environment
|
265
|
+
option :environment, aliases: '--env'
|
266
266
|
define_method 'db:deprovision' do |handle|
|
267
267
|
database = ensure_database(options.merge(db: handle))
|
268
268
|
CLI.logger.info "Deprovisioning #{database.handle}..."
|
@@ -278,7 +278,7 @@ module Aptible
|
|
278
278
|
end
|
279
279
|
|
280
280
|
desc 'db:backup HANDLE', 'Backup a database'
|
281
|
-
option :environment
|
281
|
+
option :environment, aliases: '--env'
|
282
282
|
define_method 'db:backup' do |handle|
|
283
283
|
database = ensure_database(options.merge(db: handle))
|
284
284
|
CLI.logger.info "Backing up #{database.handle}..."
|
@@ -287,7 +287,7 @@ module Aptible
|
|
287
287
|
end
|
288
288
|
|
289
289
|
desc 'db:reload HANDLE', 'Reload a database'
|
290
|
-
option :environment
|
290
|
+
option :environment, aliases: '--env'
|
291
291
|
define_method 'db:reload' do |handle|
|
292
292
|
database = ensure_database(options.merge(db: handle))
|
293
293
|
CLI.logger.info "Reloading #{database.handle}..."
|
@@ -300,7 +300,7 @@ module Aptible
|
|
300
300
|
'[--container-profile PROFILE] [--iops IOPS] ' \
|
301
301
|
'[--volume-type [gp2, gp3]]',
|
302
302
|
'Restart a database'
|
303
|
-
option :environment
|
303
|
+
option :environment, aliases: '--env'
|
304
304
|
option :container_size, type: :numeric
|
305
305
|
option :container_profile, type: :string,
|
306
306
|
desc: 'Examples: m c r'
|
@@ -335,7 +335,7 @@ module Aptible
|
|
335
335
|
desc 'db:modify HANDLE ' \
|
336
336
|
'[--iops IOPS] [--volume-type [gp2, gp3]]',
|
337
337
|
'Modify a database disk'
|
338
|
-
option :environment
|
338
|
+
option :environment, aliases: '--env'
|
339
339
|
option :iops, type: :numeric
|
340
340
|
option :volume_type
|
341
341
|
define_method 'db:modify' do |handle|
|
@@ -354,7 +354,7 @@ module Aptible
|
|
354
354
|
end
|
355
355
|
|
356
356
|
desc 'db:url HANDLE', 'Display a database URL'
|
357
|
-
option :environment
|
357
|
+
option :environment, aliases: '--env'
|
358
358
|
option :type, type: :string
|
359
359
|
define_method 'db:url' do |handle|
|
360
360
|
database = ensure_database(options.merge(db: handle))
|
@@ -371,7 +371,7 @@ module Aptible
|
|
371
371
|
' ENVIRONMENT_HANDLE]', 'Rename a database handle. In order'\
|
372
372
|
' for the new database handle to appear in log drain and'\
|
373
373
|
' metric drain destinations, you must reload the database.'
|
374
|
-
option :environment
|
374
|
+
option :environment, aliases: '--env'
|
375
375
|
define_method 'db:rename' do |old_handle, new_handle|
|
376
376
|
env = ensure_environment(options)
|
377
377
|
db = ensure_database(options.merge(db: old_handle))
|
@@ -8,7 +8,7 @@ module Aptible
|
|
8
8
|
include Helpers::Token
|
9
9
|
|
10
10
|
desc 'environment:list', 'List all environments'
|
11
|
-
option :environment
|
11
|
+
option :environment, aliases: '--env'
|
12
12
|
define_method 'environment:list' do
|
13
13
|
Formatter.render(Renderer.current) do |root|
|
14
14
|
root.keyed_list(
|
@@ -25,7 +25,7 @@ module Aptible
|
|
25
25
|
|
26
26
|
desc 'environment:ca_cert',
|
27
27
|
'Retrieve the CA certificate associated with the environment'
|
28
|
-
option :environment
|
28
|
+
option :environment, aliases: '--env'
|
29
29
|
define_method 'environment:ca_cert' do
|
30
30
|
Formatter.render(Renderer.current) do |root|
|
31
31
|
root.grouped_keyed_list(
|
@@ -19,11 +19,11 @@ module Aptible
|
|
19
19
|
option :drain_databases, default: true, type: :boolean
|
20
20
|
option :drain_ephemeral_sessions, default: true, type: :boolean
|
21
21
|
option :drain_proxies, default: true, type: :boolean
|
22
|
-
option :environment
|
22
|
+
option :environment, aliases: '--env'
|
23
23
|
end
|
24
24
|
|
25
25
|
desc 'log_drain:list', 'List all Log Drains'
|
26
|
-
option :environment
|
26
|
+
option :environment, aliases: '--env'
|
27
27
|
define_method 'log_drain:list' do
|
28
28
|
Formatter.render(Renderer.current) do |root|
|
29
29
|
root.grouped_keyed_list(
|
@@ -137,7 +137,7 @@ module Aptible
|
|
137
137
|
|
138
138
|
desc 'log_drain:deprovision HANDLE --environment ENVIRONMENT',
|
139
139
|
'Deprovisions a log drain'
|
140
|
-
option :environment
|
140
|
+
option :environment, aliases: '--env'
|
141
141
|
define_method 'log_drain:deprovision' do |handle|
|
142
142
|
account = ensure_environment(options)
|
143
143
|
drain = ensure_log_drain(account, handle)
|
@@ -11,7 +11,7 @@ module Aptible
|
|
11
11
|
desc 'maintenance:apps',
|
12
12
|
'List Apps impacted by maintenance schedules where '\
|
13
13
|
'restarts are required'
|
14
|
-
option :environment
|
14
|
+
option :environment, aliases: '--env'
|
15
15
|
define_method 'maintenance:apps' do
|
16
16
|
found_maintenance = false
|
17
17
|
m = maintenance_apps
|
@@ -46,7 +46,7 @@ module Aptible
|
|
46
46
|
desc 'maintenance:dbs',
|
47
47
|
'List Databases impacted by maintenance schedules where '\
|
48
48
|
'restarts are required'
|
49
|
-
option :environment
|
49
|
+
option :environment, aliases: '--env'
|
50
50
|
define_method 'maintenance:dbs' do
|
51
51
|
found_maintenance = false
|
52
52
|
m = maintenance_databases
|
@@ -18,7 +18,7 @@ module Aptible
|
|
18
18
|
include Helpers::MetricDrain
|
19
19
|
|
20
20
|
desc 'metric_drain:list', 'List all Metric Drains'
|
21
|
-
option :environment
|
21
|
+
option :environment, aliases: '--env'
|
22
22
|
define_method 'metric_drain:list' do
|
23
23
|
Formatter.render(Renderer.current) do |root|
|
24
24
|
root.grouped_keyed_list(
|
@@ -40,7 +40,7 @@ module Aptible
|
|
40
40
|
'--db DATABASE_HANDLE --environment ENVIRONMENT',
|
41
41
|
'Create an InfluxDB Metric Drain'
|
42
42
|
option :db, type: :string
|
43
|
-
option :environment
|
43
|
+
option :environment, aliases: '--env'
|
44
44
|
|
45
45
|
define_method 'metric_drain:create:influxdb' do |handle|
|
46
46
|
account = ensure_environment(options)
|
@@ -66,7 +66,7 @@ module Aptible
|
|
66
66
|
option :password, type: :string
|
67
67
|
option :url, type: :string
|
68
68
|
option :db, type: :string
|
69
|
-
option :environment
|
69
|
+
option :environment, aliases: '--env'
|
70
70
|
define_method 'metric_drain:create:influxdb:custom' do |handle|
|
71
71
|
account = ensure_environment(options)
|
72
72
|
|
@@ -95,7 +95,7 @@ module Aptible
|
|
95
95
|
option :org, type: :string
|
96
96
|
option :token, type: :string
|
97
97
|
option :url, type: :string
|
98
|
-
option :environment
|
98
|
+
option :environment, aliases: '--env'
|
99
99
|
define_method 'metric_drain:create:influxdb:customv2' do |handle|
|
100
100
|
account = ensure_environment(options)
|
101
101
|
|
@@ -121,7 +121,7 @@ module Aptible
|
|
121
121
|
'Create a Datadog Metric Drain'
|
122
122
|
option :api_key, type: :string
|
123
123
|
option :site, type: :string
|
124
|
-
option :environment
|
124
|
+
option :environment, aliases: '--env'
|
125
125
|
define_method 'metric_drain:create:datadog' do |handle|
|
126
126
|
account = ensure_environment(options)
|
127
127
|
|
@@ -150,7 +150,7 @@ module Aptible
|
|
150
150
|
|
151
151
|
desc 'metric_drain:deprovision HANDLE --environment ENVIRONMENT',
|
152
152
|
'Deprovisions a Metric Drain'
|
153
|
-
option :environment
|
153
|
+
option :environment, aliases: '--env'
|
154
154
|
define_method 'metric_drain:deprovision' do |handle|
|
155
155
|
account = ensure_environment(options)
|
156
156
|
drain = ensure_metric_drain(account, handle)
|
@@ -65,11 +65,14 @@ module Aptible
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
+
|
68
69
|
no_commands do
|
69
70
|
alias_method 'services:sizing_policy',
|
70
71
|
'services:autoscaling_policy'
|
71
72
|
end
|
72
73
|
|
74
|
+
map 'services:sizing_policy' => 'services:autoscaling_policy'
|
75
|
+
|
73
76
|
desc 'services:autoscaling_policy:set SERVICE '\
|
74
77
|
'--autoscaling-type (horizontal|vertical) '\
|
75
78
|
'[--metric-lookback-seconds SECONDS] '\
|
@@ -196,10 +199,14 @@ module Aptible
|
|
196
199
|
service.create_service_sizing_policy!(**args)
|
197
200
|
end
|
198
201
|
end
|
202
|
+
|
199
203
|
no_commands do
|
200
204
|
alias_method 'services:sizing_policy:set',
|
201
205
|
'services:autoscaling_policy:set'
|
202
206
|
end
|
207
|
+
|
208
|
+
map 'services:sizing_policy:set' =>
|
209
|
+
'services:autoscaling_policy:set'
|
203
210
|
end
|
204
211
|
end
|
205
212
|
end
|
data/lib/aptible/cli/version.rb
CHANGED
@@ -93,11 +93,13 @@ describe Aptible::CLI::Agent do
|
|
93
93
|
|
94
94
|
s1 = Fabricate(
|
95
95
|
:service,
|
96
|
-
app: app, process_type: 's1', command: 'true', container_count: 2
|
96
|
+
app: app, process_type: 's1', command: 'true', container_count: 2,
|
97
|
+
instance_class: 'm5'
|
97
98
|
)
|
98
99
|
s2 = Fabricate(
|
99
100
|
:service,
|
100
|
-
app: app, process_type: 's2', container_memory_limit_mb: 2048
|
101
|
+
app: app, process_type: 's2', container_memory_limit_mb: 2048,
|
102
|
+
instance_class: 'r5'
|
101
103
|
)
|
102
104
|
|
103
105
|
expected_json = [
|
@@ -118,6 +120,7 @@ describe Aptible::CLI::Agent do
|
|
118
120
|
'id' => s1.id,
|
119
121
|
'command' => s1.command,
|
120
122
|
'container_count' => s1.container_count,
|
123
|
+
'container_profile' => 'm',
|
121
124
|
'container_size' => s1.container_memory_limit_mb,
|
122
125
|
'created_at' => fmt_time(s1.created_at)
|
123
126
|
},
|
@@ -126,6 +129,7 @@ describe Aptible::CLI::Agent do
|
|
126
129
|
'id' => s2.id,
|
127
130
|
'command' => 'CMD',
|
128
131
|
'container_count' => s2.container_count,
|
132
|
+
'container_profile' => 'r',
|
129
133
|
'container_size' => s2.container_memory_limit_mb,
|
130
134
|
'created_at' => fmt_time(s2.created_at)
|
131
135
|
}
|
@@ -109,6 +109,17 @@ describe Aptible::CLI::Agent do
|
|
109
109
|
subject.send('config:unset', 'FOO')
|
110
110
|
end
|
111
111
|
|
112
|
+
it 'unsets environment variables even if the user passes a value' do
|
113
|
+
expect(app).to receive(:create_operation!)
|
114
|
+
.with(type: 'configure', env: { 'FOO' => '' })
|
115
|
+
.and_return(operation)
|
116
|
+
|
117
|
+
expect(subject).to receive(:attach_to_operation_logs)
|
118
|
+
.with(operation)
|
119
|
+
|
120
|
+
subject.send('config:unset', 'FOO=whoops')
|
121
|
+
end
|
122
|
+
|
112
123
|
it 'rejects environment variables that start with -' do
|
113
124
|
expect { subject.send('config:rm', '-foo') }
|
114
125
|
.to raise_error(/invalid argument/im)
|
@@ -142,7 +142,8 @@ describe Aptible::CLI::Agent do
|
|
142
142
|
|
143
143
|
expect { subject.send('operation:logs', 1) }
|
144
144
|
.to raise_error('Unable to retrieve the operation\'s logs. '\
|
145
|
-
'If the issue persists please contact support for assistance
|
145
|
+
'If the issue persists please contact support for assistance, ' \
|
146
|
+
"or view them at https://app.aptible.com/operations/#{operation_id}")
|
146
147
|
end
|
147
148
|
it 'errors when body is empty' do
|
148
149
|
operation_id = SecureRandom.uuid
|
@@ -163,7 +164,8 @@ describe Aptible::CLI::Agent do
|
|
163
164
|
|
164
165
|
expect { subject.send('operation:logs', 1) }
|
165
166
|
.to raise_error('Unable to retrieve the operation\'s logs. '\
|
166
|
-
'If the issue persists please contact support for assistance
|
167
|
+
'If the issue persists please contact support for assistance, ' \
|
168
|
+
"or view them at https://app.aptible.com/operations/#{operation_id}")
|
167
169
|
end
|
168
170
|
it 'errors when s3 itself returns an error code' do
|
169
171
|
operation_id = SecureRandom.uuid
|
@@ -46,6 +46,14 @@ describe Aptible::CLI::Agent do
|
|
46
46
|
expect(captured_output_text.split("\n")).to include('Container Count: 3')
|
47
47
|
end
|
48
48
|
|
49
|
+
it 'lists container profile' do
|
50
|
+
Fabricate(:service, app: app, instance_class: 'u7')
|
51
|
+
subject.send('services')
|
52
|
+
|
53
|
+
expect(captured_output_text.split("\n"))
|
54
|
+
.to include('Container Profile: u')
|
55
|
+
end
|
56
|
+
|
49
57
|
it 'lists multiple services' do
|
50
58
|
Fabricate(:service, app: app, process_type: 'foo')
|
51
59
|
Fabricate(:service, app: app, process_type: 'bar')
|
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.24.
|
4
|
+
version: 0.24.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -472,7 +472,7 @@ homepage: https://github.com/aptible/aptible-cli
|
|
472
472
|
licenses:
|
473
473
|
- MIT
|
474
474
|
metadata: {}
|
475
|
-
post_install_message:
|
475
|
+
post_install_message:
|
476
476
|
rdoc_options: []
|
477
477
|
require_paths:
|
478
478
|
- lib
|
@@ -487,8 +487,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
487
487
|
- !ruby/object:Gem::Version
|
488
488
|
version: '0'
|
489
489
|
requirements: []
|
490
|
-
rubygems_version: 3.1
|
491
|
-
signing_key:
|
490
|
+
rubygems_version: 3.0.3.1
|
491
|
+
signing_key:
|
492
492
|
specification_version: 4
|
493
493
|
summary: Command-line interface for Aptible services
|
494
494
|
test_files:
|