aptible-cli 0.18.2 → 0.18.3

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: cf958faed8401636f811f03296e187e9af011fef3d6ce6aa3bc7f2aee315d5c8
4
- data.tar.gz: 36214902974167a2748685d63fa9d1d659c64d4f752e3b813aeb7adb907f601b
3
+ metadata.gz: 99e721103b6988c5c8e41d11935449de499b29db00513732c031098f29613f29
4
+ data.tar.gz: 19b4bc6ce3b14b759ef100eab8ca95f12809bb0fd41e5c36b709dfd224ab774b
5
5
  SHA512:
6
- metadata.gz: a1a85e655dd7e0d3267035baca9c8c5898193f524a3ac842961ec62aa0e3b4f951c89a0a1dd5a1adcf80b840b729dafb90238214d6224eff1fd524a54fb90b21
7
- data.tar.gz: d85e946cb9adee2314f31078029033bd62ea44a0ef23d673c434e422817c17cf7094bff714ce5b6862c52135f30b030ae7d52a4f72e8052f2fc99b372b3016ca
6
+ metadata.gz: 7c5e417a9ab05f619e140ff6c444bdd9723aa6d9b5063678201e018873a8065f245074ba872fc0fd00763a54e9f7c156e67762118bdcb156893f8a9668aab8b6
7
+ data.tar.gz: 9355ca55bb61608245dfd0c8a1a7463ac555ab365cf389f12bec78b293861ab43f8776aef2c3c5fe8f0a0b42e3730f59ea3025d03c84ffc46d048c7b6933e90c
data/README.md CHANGED
@@ -51,7 +51,7 @@ Commands:
51
51
  aptible db:modify HANDLE [--iops IOPS] [--volume-type [gp2, gp3]] # Modify a database disk
52
52
  aptible db:reload HANDLE # Reload a database
53
53
  aptible db:replicate HANDLE REPLICA_HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--logical --version VERSION] [--key-arn KEY_ARN] # Create a replica/follower of a database
54
- aptible db:restart HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB][--iops IOPS] [--volume-type [gp2, gp3]] # Restart a database
54
+ aptible db:restart HANDLE [--container-size SIZE_MB] [--disk-size SIZE_GB] [--iops IOPS] [--volume-type [gp2, gp3]] # Restart a database
55
55
  aptible db:tunnel HANDLE # Create a local tunnel to a database
56
56
  aptible db:url HANDLE # Display a database URL
57
57
  aptible db:versions # List available database versions
@@ -18,6 +18,7 @@ require_relative 'helpers/vhost/option_set_builder'
18
18
  require_relative 'helpers/tunnel'
19
19
  require_relative 'helpers/system'
20
20
  require_relative 'helpers/security_key'
21
+ require_relative 'helpers/config_path'
21
22
 
22
23
  require_relative 'subcommands/apps'
23
24
  require_relative 'subcommands/config'
@@ -43,6 +44,7 @@ module Aptible
43
44
  include Helpers::Token
44
45
  include Helpers::Ssh
45
46
  include Helpers::System
47
+ include Helpers::ConfigPath
46
48
  include Subcommands::Apps
47
49
  include Subcommands::Config
48
50
  include Subcommands::DB
@@ -209,7 +211,7 @@ module Aptible
209
211
  # further: to do so, edit the file `.aptible/nag_toolbelt` and put a
210
212
  # timestamp far into the future. For example, writing 1577836800 will
211
213
  # disable the warning until 2020.
212
- nag_file = File.join ENV['HOME'], '.aptible', 'nag_toolbelt'
214
+ nag_file = File.join aptible_config_path, 'nag_toolbelt'
213
215
  nag_frequency = 12.hours
214
216
 
215
217
  last_nag = begin
@@ -0,0 +1,11 @@
1
+ module Aptible
2
+ module CLI
3
+ module Helpers
4
+ module ConfigPath
5
+ def aptible_config_path
6
+ ENV['APTIBLE_CONFIG_PATH'] || (File.join ENV['HOME'], '.aptible')
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,7 +1,11 @@
1
+ require_relative 'config_path'
2
+
1
3
  module Aptible
2
4
  module CLI
3
5
  module Helpers
4
6
  module Ssh
7
+ include Helpers::ConfigPath
8
+
5
9
  def connect_to_ssh_portal(operation, *extra_ssh_args)
6
10
  # NOTE: This is a little tricky to get rigt, so before you make any
7
11
  # changes, read this.
@@ -126,7 +130,7 @@ module Aptible
126
130
  end
127
131
 
128
132
  def ssh_dir
129
- File.join ENV['HOME'], '.aptible', 'ssh'
133
+ File.join aptible_config_path, 'ssh'
130
134
  end
131
135
 
132
136
  def ssh_config_file
@@ -1,9 +1,13 @@
1
1
  require 'aptible/auth'
2
2
 
3
+ require_relative 'config_path'
4
+
3
5
  module Aptible
4
6
  module CLI
5
7
  module Helpers
6
8
  module Token
9
+ include Helpers::ConfigPath
10
+
7
11
  TOKEN_ENV_VAR = 'APTIBLE_ACCESS_TOKEN'.freeze
8
12
 
9
13
  def fetch_token
@@ -40,7 +44,7 @@ module Aptible
40
44
  end
41
45
 
42
46
  def token_file
43
- File.join ENV['HOME'], '.aptible', 'tokens.json'
47
+ File.join(aptible_config_path, 'tokens.json').freeze
44
48
  end
45
49
  end
46
50
  end
@@ -5,8 +5,17 @@ module Aptible
5
5
  NO_NESTING = Object.new.freeze
6
6
 
7
7
  def inject_backup(node, backup, include_db: false)
8
+ origin = if backup.manual && !backup.copied_from
9
+ "manual, #{backup.created_from_operation.user_email}"
10
+ elsif backup.manual && backup.copied_from
11
+ 'manual, copy'
12
+ elsif backup.copied_from
13
+ 'automatic, copy'
14
+ else
15
+ 'automatic'
16
+ end
8
17
  description = "#{backup.id}: #{backup.created_at}, " \
9
- "#{backup.aws_region}"
18
+ "#{backup.aws_region}, #{origin}"
10
19
 
11
20
  if include_db
12
21
  db = backup.database_with_deleted
@@ -30,6 +39,13 @@ module Aptible
30
39
  inject_backup(n, backup.copied_from)
31
40
  end
32
41
  end
42
+
43
+ if backup.created_from_operation && \
44
+ backup.manual && !backup.copied_from
45
+ node.keyed_object('created_from_operation', 'id') do |n|
46
+ inject_operation(n, backup.created_from_operation)
47
+ end
48
+ end
33
49
  end
34
50
 
35
51
  def inject_deleted_database(node, database, account)
@@ -49,7 +65,9 @@ module Aptible
49
65
  def inject_operation(node, operation)
50
66
  node.value('id', operation.id)
51
67
  node.value('status', operation.status)
52
- node.value('git_ref', operation.git_ref)
68
+ if %w(deploy rebuild).include?(operation.type)
69
+ node.value('git_ref', operation.git_ref)
70
+ end
53
71
  node.value('user_email', operation.user_email)
54
72
  node.value('created_at', operation.created_at)
55
73
  end
@@ -279,7 +279,7 @@ module Aptible
279
279
  end
280
280
 
281
281
  desc 'db:restart HANDLE ' \
282
- '[--container-size SIZE_MB] [--disk-size SIZE_GB]' \
282
+ '[--container-size SIZE_MB] [--disk-size SIZE_GB] ' \
283
283
  '[--iops IOPS] [--volume-type [gp2, gp3]]',
284
284
  'Restart a database'
285
285
  option :environment
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.18.2'.freeze
3
+ VERSION = '0.18.3'.freeze
4
4
  end
5
5
  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.18.2
4
+ version: 0.18.3
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-09 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-resource
@@ -274,6 +274,7 @@ files:
274
274
  - lib/aptible/cli/formatter/value.rb
275
275
  - lib/aptible/cli/helpers/app.rb
276
276
  - lib/aptible/cli/helpers/app_or_database.rb
277
+ - lib/aptible/cli/helpers/config_path.rb
277
278
  - lib/aptible/cli/helpers/database.rb
278
279
  - lib/aptible/cli/helpers/environment.rb
279
280
  - lib/aptible/cli/helpers/operation.rb