convox_installer 1.0.7 → 1.0.8
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/README.md +2 -2
- data/lib/convox/client.rb +3 -3
- data/lib/convox_installer/config.rb +3 -3
- data/lib/convox_installer/version.rb +1 -1
- data/spec/lib/convox_installer/config_spec.rb +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae064bb3fa4954c0edd52b0d97127477ed73f0059c36b6c71f0f091b5b93608e
|
4
|
+
data.tar.gz: 8cadcac34a2eeaf4b68f323b5e9c2dd9ec528be4cf14a5fe2b9145cb0cb9d8cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ba638e5dffe9ab773f4b5f5bad934fc112c2cdc2cede74ca7e8ae2351bf900d33a7681ec20e9bbcbd7813e62e1e4b927aa78ba30041ec0cc3644bd2a753f4e
|
7
|
+
data.tar.gz: a1e4ef7404bf7da3d425c0d5ac0192d035949bf3467a28fee45b244316e07473cff3dcfe361768f7f638984ac1949c5ccdc68d5cb9ddcfc16c1da1bcb9c19186
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ You can see a complete example in [`examples/full_installation.rb`](./examples/f
|
|
50
50
|
## Config
|
51
51
|
|
52
52
|
Config is loaded from ENV vars, or from saved JSON data at
|
53
|
-
`./.installer_config`. The script will save all of the user's responses into `./.installer_config` (in the current directory).
|
53
|
+
`./.installer_config.json`. The script will save all of the user's responses into `./.installer_config.json` (in the current directory).
|
54
54
|
|
55
55
|
## Customize the Config Prompts
|
56
56
|
|
@@ -135,7 +135,7 @@ Makes sure that the `convox` and `aws` CLI tools are installed on this system. I
|
|
135
135
|
|
136
136
|
#### `prompt_for_config`
|
137
137
|
|
138
|
-
Loads config from ENV vars, or from saved config at `./.installer_config`.
|
138
|
+
Loads config from ENV vars, or from saved config at `./.installer_config.json`.
|
139
139
|
If any config settings are missing, it prompts the user for input. Finally, it shows a summary of the config, and asks the user if they want to proceed with the installation. If the user enters `y` (or `yes`), the `prompt_for_config` method completes. If they enter `n` (or `no`), we loop over every setting and let them press "enter" to keep the current value, or provide a new value to correct any mistakes.
|
140
140
|
|
141
141
|
#### `backup_convox_host_and_rack`
|
data/lib/convox/client.rb
CHANGED
@@ -23,6 +23,8 @@ module Convox
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def backup_convox_host_and_rack
|
26
|
+
FileUtils.mkdir_p CONVOX_DIR
|
27
|
+
|
26
28
|
%w[host rack].each do |f|
|
27
29
|
path = File.join(CONVOX_DIR, f)
|
28
30
|
if File.exist?(path)
|
@@ -70,9 +72,7 @@ module Convox
|
|
70
72
|
def rack_already_installed?
|
71
73
|
require_config(%i[ aws_region stack_name ])
|
72
74
|
|
73
|
-
unless File.exist?(AUTH_FILE)
|
74
|
-
raise "Could not find auth file at #{AUTH_FILE}!"
|
75
|
-
end
|
75
|
+
return unless File.exist?(AUTH_FILE)
|
76
76
|
|
77
77
|
region = config.fetch(:aws_region)
|
78
78
|
stack_name = config.fetch(:stack_name)
|
@@ -7,7 +7,7 @@ require "securerandom"
|
|
7
7
|
|
8
8
|
module ConvoxInstaller
|
9
9
|
class Config
|
10
|
-
CONFIG_FILE = File.expand_path("./.installer_config").freeze
|
10
|
+
CONFIG_FILE = File.expand_path("./.installer_config.json").freeze
|
11
11
|
|
12
12
|
attr_accessor :logger, :config, :prompts, :highline
|
13
13
|
|
@@ -170,8 +170,8 @@ module ConvoxInstaller
|
|
170
170
|
|
171
171
|
def save_config_to_file
|
172
172
|
# FileUtils.mkdir_p File.expand_path("~/.convox")
|
173
|
-
File.open(CONFIG_FILE,
|
174
|
-
f.puts(
|
173
|
+
File.open(CONFIG_FILE, 'w') do |f|
|
174
|
+
f.puts(JSON.pretty_generate(config: config))
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -5,7 +5,7 @@ require "securerandom"
|
|
5
5
|
|
6
6
|
RSpec.describe ConvoxInstaller::Config do
|
7
7
|
before(:each) do
|
8
|
-
stub_const('ConvoxInstaller::Config::CONFIG_FILE', '/path/to/.installer_config')
|
8
|
+
stub_const('ConvoxInstaller::Config::CONFIG_FILE', '/path/to/.installer_config.json')
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
@@ -13,7 +13,7 @@ RSpec.describe ConvoxInstaller::Config do
|
|
13
13
|
ENV.delete "AWS_ACCESS_KEY_ID"
|
14
14
|
end
|
15
15
|
|
16
|
-
it "loads the saved config from ./.installer_config" do
|
16
|
+
it "loads the saved config from ./.installer_config.json" do
|
17
17
|
expect(described_class).to receive(:config_file_exists?).and_return(true)
|
18
18
|
expect(described_class).to receive(:read_config_file).and_return(
|
19
19
|
'{ "config": { "aws_region": "us-west-2", "aws_access_key_id": "1234" } }'
|
@@ -92,7 +92,7 @@ Please enter your AWS Access Key ID: Please enter your AWS Secret Access Key:
|
|
92
92
|
AWS Access Key ID: asdf
|
93
93
|
AWS Secret Access Key: xkcd
|
94
94
|
|
95
|
-
We've saved your configuration to: /path/to/.installer_config
|
95
|
+
We've saved your configuration to: /path/to/.installer_config.json
|
96
96
|
If anything goes wrong during the installation, you can restart the script to reload the config and continue.
|
97
97
|
|
98
98
|
Please double check all of these configuration details.
|
@@ -114,7 +114,7 @@ Please enter your AWS Access Key ID: |asdf| Please enter your AWS Secret Access
|
|
114
114
|
AWS Access Key ID: sdfg
|
115
115
|
AWS Secret Access Key: xkcd
|
116
116
|
|
117
|
-
We've saved your configuration to: /path/to/.installer_config
|
117
|
+
We've saved your configuration to: /path/to/.installer_config.json
|
118
118
|
If anything goes wrong during the installation, you can restart the script to reload the config and continue.
|
119
119
|
|
120
120
|
Please double check all of these configuration details.
|
@@ -157,7 +157,7 @@ EOS
|
|
157
157
|
{
|
158
158
|
key: :admin_password,
|
159
159
|
title: "Admin Password",
|
160
|
-
value: -> () { SecureRandom.hex(8) },
|
160
|
+
value: -> (c) { SecureRandom.hex(8) },
|
161
161
|
},
|
162
162
|
]
|
163
163
|
|
@@ -222,7 +222,7 @@ Please enter your Docker Registry Access Key ID: Please enter your Docker Regist
|
|
222
222
|
Admin Email: admin@test.com
|
223
223
|
Admin Password: 99a6f67de0c7a117
|
224
224
|
|
225
|
-
We've saved your configuration to: /path/to/.installer_config
|
225
|
+
We've saved your configuration to: /path/to/.installer_config.json
|
226
226
|
If anything goes wrong during the installation, you can restart the script to reload the config and continue.
|
227
227
|
|
228
228
|
Please double check all of these configuration details.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convox_installer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Form Applications Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
131
|
+
rubygems_version: 3.2.11
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Build a Convox installation workflow
|