convox_installer 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -12
- data/convox_installer.gemspec +3 -3
- data/examples/full_installation.rb +119 -32
- data/lib/convox/client.rb +2 -23
- data/lib/convox_installer/version.rb +1 -1
- data/spec/lib/convox/client_spec.rb +2 -90
- data/terraform/rds.tf.erb +2 -2
- 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: 6a149716dcd959d0f5dc6b3eae5e4840a354ea07df9c8cf4b35efab5e8df1bbf
|
4
|
+
data.tar.gz: 3d5e5ee559ec366960955b0103ac55c1208ae5d7a877eda07ca8b1d0ea82d740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28484a1e6a93193426e7258e706da77fef934bcf5a5066b0a5cf7db59105a6787dedd4af2fac4601c5add8a1c2627a43d04487908d0baea7cd0e79bbc7c40f18
|
7
|
+
data.tar.gz: 3ee1dc4d183a3e31bf25113a33f881dc772ccd185e01868dd092eddfaa4798daf58f665327c0eea931153a557cbff151bd4bc3be8727abe7eafb05fb71f37619
|
data/README.md
CHANGED
@@ -8,7 +8,6 @@ This gem provides a DSL so that you can write a script that walks your users thr
|
|
8
8
|
|
9
9
|
- MacOS
|
10
10
|
- Convox v3 CLI
|
11
|
-
- Runtime integration installed in your AWS account. See: https://docs.convox.com/getting-started/introduction/
|
12
11
|
|
13
12
|
_Please let us know if you need to run this script on Linux. Linux support should not be too difficult to implement, but unfortunately we probably won't be able to support Windows._
|
14
13
|
|
@@ -27,10 +26,12 @@ We have successfully set up a number of test and production deployments using th
|
|
27
26
|
- Idempotent. If this script crashes, you can restart it and it will pick up
|
28
27
|
where it left off. Every step looks up the existing state, and only makes a change
|
29
28
|
if things are not yet set up (or out of sync).
|
30
|
-
- Ensures that the `convox` and `
|
29
|
+
- Ensures that the `convox` and `terraform` CLI tools are installed
|
31
30
|
- Wraps the `convox` CLI and parses JSON output from API calls
|
32
|
-
- Add
|
31
|
+
- Add a Docker Repository (e.g. ECR registry)
|
33
32
|
- Set up an S3 bucket with an optional CORS policy
|
33
|
+
- Set up an RDS database (Postgres)
|
34
|
+
- Set up an Elasticache cluster (Redis)
|
34
35
|
|
35
36
|
## Introduction
|
36
37
|
|
@@ -147,7 +148,7 @@ Shows a heading and optional details.
|
|
147
148
|
|
148
149
|
#### `ensure_requirements!`
|
149
150
|
|
150
|
-
Makes sure that the `convox` and `
|
151
|
+
Makes sure that the `convox` and `terraform` CLI tools are installed on this system. If not, shows installation instructions and exits.
|
151
152
|
|
152
153
|
#### `prompt_for_config`
|
153
154
|
|
@@ -252,24 +253,21 @@ Adds an RDS database to your Terraform config.
|
|
252
253
|
- **Optional Config:**
|
253
254
|
- `database_allocated_storage` _(default: 30)_
|
254
255
|
- `database_engine` _(default: 'postgres')_
|
255
|
-
- `database_engine_version` _(default: '14.
|
256
|
-
- `database_instance_class` _(default: 'db.t3.
|
256
|
+
- `database_engine_version` _(default: '14.8')_
|
257
|
+
- `database_instance_class` _(default: 'db.t3.small')_
|
257
258
|
- `database_multi_az` _(default: true)_
|
258
259
|
|
259
|
-
#### `
|
260
|
+
#### `add_elasticache_cluster`
|
260
261
|
|
261
262
|
Adds an Elasticache cluster to your Terraform config.
|
262
263
|
|
263
264
|
- **Optional Config:**
|
264
265
|
- `engine` _(default: 'redis')_
|
265
|
-
- `engine_version` _(default: '6.
|
266
|
-
- `node_type` _(default: 'cache.
|
267
|
-
- `database_instance_class` _(default: 'db.t3.medium')_
|
266
|
+
- `engine_version` _(default: '6.x')_
|
267
|
+
- `node_type` _(default: 'cache.t3.medium')_
|
268
268
|
- `num_cache_nodes` _(default: 1)_
|
269
269
|
- `port` _(default: 6379)_
|
270
270
|
|
271
|
-
_IMPORTANT: Make sure you specify a full version string (e.g. `6.2.5`), and not a partial version (e.g. `6.2`.) A partial version will cause Terraform to delete and recreate the cluster on every run._
|
272
|
-
|
273
271
|
#### `apply_terraform_update!`
|
274
272
|
|
275
273
|
Runs `terraform apply -auto-approve` to apply any changes to your Terraform configuration (add new resources, etc.)
|
data/convox_installer.gemspec
CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.name = 'convox_installer'
|
8
8
|
s.version = ConvoxInstaller::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
|
-
s.authors = ['
|
11
|
-
s.email = ['support@
|
12
|
-
s.homepage = 'https://github.com/
|
10
|
+
s.authors = ['DocSpring, Inc.']
|
11
|
+
s.email = ['support@docspring.com']
|
12
|
+
s.homepage = 'https://github.com/DocSpring/convox_installer'
|
13
13
|
s.summary = 'Build a Convox installation workflow'
|
14
14
|
s.description = 'Build a Convox installation workflow'
|
15
15
|
s.license = 'MIT'
|
@@ -9,6 +9,7 @@
|
|
9
9
|
# gem "convox_installer"
|
10
10
|
# end
|
11
11
|
|
12
|
+
require 'English'
|
12
13
|
$LOAD_PATH << File.expand_path('../lib', __dir__)
|
13
14
|
require 'pry-byebug'
|
14
15
|
|
@@ -99,54 +100,138 @@ config = prompt_for_config
|
|
99
100
|
|
100
101
|
backup_convox_host_and_rack
|
101
102
|
install_convox
|
102
|
-
|
103
|
-
validate_convox_auth_and_write_host!
|
103
|
+
validate_convox_rack_and_write_current!
|
104
104
|
validate_convox_rack_api!
|
105
105
|
|
106
106
|
create_convox_app!
|
107
107
|
set_default_app_for_directory!
|
108
108
|
add_docker_registry!
|
109
|
-
create_s3_bucket!
|
110
109
|
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
add_s3_bucket
|
111
|
+
add_rds_database
|
112
|
+
add_elasticache_cluster
|
113
|
+
|
114
|
+
apply_terraform_update!
|
115
|
+
|
116
|
+
unless config[:sidekiq_cloudwatch_iam_credentials]
|
117
|
+
logger.info "Looking up IAM user for Sidekiq CloudWatch metrics (#{config.fetch(:sidekiq_cloudwatch_iam_username)})..."
|
118
|
+
|
119
|
+
aws_cli_credentials = "AWS_ACCESS_KEY_ID=#{config.fetch(:aws_access_key_id)} " \
|
120
|
+
"AWS_SECRET_ACCESS_KEY=#{config.fetch(:aws_secret_access_key)}"
|
121
|
+
`#{aws_cli_credentials} aws iam get-user \
|
122
|
+
--user-name #{config.fetch(:sidekiq_cloudwatch_iam_username)} 2>/dev/null`
|
123
|
+
unless $CHILD_STATUS.success?
|
124
|
+
logger.info "Creating IAM user: #{config.fetch(:sidekiq_cloudwatch_iam_username)} with CloudWatchAgentServerPolicy..."
|
125
|
+
# IAM user needs the CloudWatchAgentServerPolicy policy
|
126
|
+
`#{aws_cli_credentials} aws iam create-user \
|
127
|
+
--user-name #{config.fetch(:sidekiq_cloudwatch_iam_username)}`
|
128
|
+
unless $CHILD_STATUS.success?
|
129
|
+
raise "Sorry, something went wrong while creating the #{config.fetch(:sidekiq_cloudwatch_iam_username)} IAM user!"
|
130
|
+
end
|
131
|
+
|
132
|
+
logger.info 'Attaching CloudWatchAgentServerPolicy...'
|
133
|
+
`#{aws_cli_credentials} aws iam attach-user-policy \
|
134
|
+
--user-name #{config.fetch(:sidekiq_cloudwatch_iam_username)} \
|
135
|
+
--policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy`
|
136
|
+
unless $CHILD_STATUS.success?
|
137
|
+
raise 'Sorry, something went wrong while attaching the CloudWatchAgentServerPolicy policy!'
|
138
|
+
end
|
139
|
+
end
|
140
|
+
logger.info "Creating IAM access token for #{config.fetch(:sidekiq_cloudwatch_iam_username)}..."
|
141
|
+
|
142
|
+
create_access_key_output_json = `#{aws_cli_credentials} aws iam create-access-key \
|
143
|
+
--user-name #{config.fetch(:sidekiq_cloudwatch_iam_username)}`
|
144
|
+
unless $CHILD_STATUS.success?
|
145
|
+
raise "Sorry, something went wrong while creating the access token for #{config.fetch(:sidekiq_cloudwatch_iam_username)}!"
|
146
|
+
end
|
147
|
+
|
148
|
+
config[:sidekiq_cloudwatch_iam_credentials] =
|
149
|
+
JSON.parse(create_access_key_output_json)['AccessKey']
|
114
150
|
|
115
|
-
|
116
|
-
|
117
|
-
puts
|
151
|
+
# Save credentials in the cached config file
|
152
|
+
File.open('./.installer_config.json', 'w') do |f|
|
153
|
+
f.puts(JSON.pretty_generate(config: config))
|
154
|
+
end
|
155
|
+
end
|
118
156
|
|
119
|
-
|
157
|
+
logger.info "======> Default domain: #{default_service_domain_name}"
|
158
|
+
logger.info ' You can use this as a CNAME record after configuring a domain in convox.yml'
|
159
|
+
logger.info ' (Note: SSL will be configured automatically.)'
|
120
160
|
|
121
|
-
|
122
|
-
|
123
|
-
|
161
|
+
logger.info 'Checking convox env...'
|
162
|
+
convox_env_output = `convox env --rack #{config.fetch(:stack_name)}`
|
163
|
+
raise 'Error running convox env' unless $CHILD_STATUS.success?
|
164
|
+
|
165
|
+
convox_env = begin
|
166
|
+
convox_env_output.split("\n").map { |s| s.split('=', 2) }.to_h
|
167
|
+
rescue StandardError
|
168
|
+
{}
|
169
|
+
end
|
170
|
+
|
171
|
+
# Add database and redis
|
172
|
+
desired_env = {
|
173
|
+
'DATABASE_URL' => rds_details[:postgres_url],
|
174
|
+
'REDIS_URL' => elasticache_details[:redis_url],
|
124
175
|
'AWS_ACCESS_KEY_ID' => s3_bucket_details.fetch(:access_key_id),
|
125
176
|
'AWS_ACCESS_KEY_SECRET' => s3_bucket_details.fetch(:secret_access_key),
|
126
177
|
'AWS_UPLOADS_S3_BUCKET' => s3_bucket_details.fetch(:name),
|
127
178
|
'AWS_UPLOADS_S3_REGION' => config.fetch(:aws_region),
|
128
|
-
'SECRET_KEY_BASE' => secret_key_base,
|
129
|
-
'
|
179
|
+
'SECRET_KEY_BASE' => config.fetch(:secret_key_base),
|
180
|
+
'SUBMISSION_DATA_ENCRYPTION_KEY' => config.fetch(:data_encryption_key),
|
130
181
|
'ADMIN_NAME' => 'Admin',
|
131
182
|
'ADMIN_EMAIL' => config.fetch(:admin_email),
|
132
|
-
'ADMIN_PASSWORD' => config.fetch(:admin_password)
|
183
|
+
'ADMIN_PASSWORD' => config.fetch(:admin_password),
|
184
|
+
'DOCSPRING_LICENSE' => config.fetch(:docspring_license),
|
185
|
+
'DISABLE_EMAILS' => 'true'
|
133
186
|
}
|
134
187
|
|
135
|
-
|
136
|
-
|
188
|
+
# Only set health check path and domain if it's not already present.
|
189
|
+
desired_env['HEALTH_CHECK_PATH'] = MINIMAL_HEALTH_CHECK_PATH if convox_env['HEALTH_CHECK_PATH'].nil?
|
190
|
+
desired_env['DOMAIN_NAME'] = default_service_domain_name if convox_env['DOMAIN_NAME'].nil?
|
191
|
+
|
192
|
+
updated_keys = []
|
193
|
+
desired_env.each_key do |key|
|
194
|
+
updated_keys << key if convox_env[key] != desired_env[key]
|
195
|
+
end
|
196
|
+
|
197
|
+
if updated_keys.none?
|
198
|
+
logger.info '=> Convox env has already been configured.'
|
199
|
+
logger.info ' You can update this by running: convox env set ...'
|
200
|
+
else
|
201
|
+
logger.info "=> Setting environment variables to configure DocSpring: #{updated_keys.join(', ')}"
|
202
|
+
env_command_params = desired_env.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
|
203
|
+
run_convox_command! "env set #{env_command_params}"
|
204
|
+
end
|
205
|
+
|
206
|
+
# If we are already using the complete health check path, then we can skip the rest.
|
207
|
+
if convox_env['HEALTH_CHECK_PATH'] == COMPLETE_HEALTH_CHECK_PATH
|
208
|
+
logger.info 'DocSpring is already set up and running.'
|
209
|
+
else
|
210
|
+
logger.info 'Checking convox processes...'
|
211
|
+
convox_processes = `convox ps --rack #{config.fetch(:stack_name)}`
|
212
|
+
if convox_processes.include?('web') && convox_processes.include?('worker')
|
213
|
+
logger.info '=> Initial deploy for DocSpring Enterprise is already done.'
|
214
|
+
else
|
215
|
+
logger.info '=> Initial deploy for DocSpring Enterprise...'
|
216
|
+
logger.info '-----> Documentation: https://docs.convox.com/deployment/deploying-changes/'
|
217
|
+
run_convox_command! 'deploy'
|
218
|
+
end
|
219
|
+
|
220
|
+
logger.info '=> Ensuring the DocSpring application container can boot successfully...'
|
221
|
+
run_convox_command! 'run command ./bin/smoke_test'
|
137
222
|
|
138
|
-
|
139
|
-
|
140
|
-
run_convox_command! 'deploy --wait'
|
223
|
+
logger.info '=> Setting up the DocSpring database...'
|
224
|
+
run_convox_command! 'run command rake db:create db:migrate db:seed'
|
141
225
|
|
142
|
-
|
143
|
-
run_convox_command! 'run
|
226
|
+
logger.info '=> Checking Postgres, Redis, Rails cache, S3 uploads, Sidekiq job processing...'
|
227
|
+
run_convox_command! 'run command rake tests:health_check'
|
144
228
|
|
145
|
-
|
146
|
-
run_convox_command! "env set --promote
|
229
|
+
logger.info '=> Updating the health check path to include database tests...'
|
230
|
+
run_convox_command! "env set --promote HEALTH_CHECK_PATH=#{COMPLETE_HEALTH_CHECK_PATH}"
|
231
|
+
end
|
147
232
|
|
148
233
|
puts
|
149
|
-
|
234
|
+
logger.info 'All done!'
|
150
235
|
puts
|
151
236
|
puts "You can now visit #{default_service_domain_name} and sign in with:"
|
152
237
|
puts
|
@@ -166,24 +251,26 @@ puts
|
|
166
251
|
puts 'To learn more about the convox CLI, run: convox --help'
|
167
252
|
puts
|
168
253
|
puts ' * View the Convox documentation: https://docs.convox.com/'
|
254
|
+
puts ' * View the DocSpring documentation: https://docspring.com/docs/'
|
169
255
|
puts
|
170
256
|
puts
|
171
|
-
puts 'To completely uninstall Convox from your AWS account,'
|
257
|
+
puts 'To completely uninstall Convox and DocSpring from your AWS account,'
|
172
258
|
puts 'run the following steps (in this order):'
|
173
259
|
puts
|
174
260
|
puts ' 1) Disable "Termination Protection" for any resource where it was enabled.'
|
175
261
|
puts
|
176
|
-
puts " 2) Delete all files from the #{
|
262
|
+
puts " 2) Delete all files from the #{s3_bucket_details.fetch(:name)} S3 bucket:"
|
177
263
|
puts
|
178
264
|
puts " export AWS_ACCESS_KEY_ID=#{config.fetch(:aws_access_key_id)}"
|
179
265
|
puts " export AWS_SECRET_ACCESS_KEY=#{config.fetch(:aws_secret_access_key)}"
|
180
266
|
puts " aws s3 rm s3://#{s3_bucket_details.fetch(:name)} --recursive"
|
181
267
|
puts
|
182
|
-
puts
|
268
|
+
puts ' 3) Uninstall Convox (deletes all AWS resources via Terraform):'
|
183
269
|
puts
|
184
|
-
puts " convox rack
|
270
|
+
puts " convox rack uninstall #{config.fetch(:stack_name)}"
|
185
271
|
puts
|
186
|
-
puts ' 4) Uninstall Convox (deletes all CloudFormation stacks and AWS resources):'
|
187
272
|
puts
|
188
|
-
puts
|
273
|
+
puts '------------------------------------------------------------------------------------'
|
274
|
+
puts 'Thank you for using DocSpring! Please contact support@docspring.com if you need any help.'
|
275
|
+
puts '------------------------------------------------------------------------------------'
|
189
276
|
puts
|
data/lib/convox/client.rb
CHANGED
@@ -16,7 +16,6 @@ module Convox
|
|
16
16
|
File.expand_path('~/.convox').freeze
|
17
17
|
end
|
18
18
|
|
19
|
-
AUTH_FILE = File.join(CONVOX_CONFIG_DIR, 'auth')
|
20
19
|
CURRENT_FILE = File.join(CONVOX_CONFIG_DIR, 'current')
|
21
20
|
|
22
21
|
attr_accessor :logger, :config
|
@@ -55,10 +54,6 @@ module Convox
|
|
55
54
|
cli_version < Gem::Version.new('4.0.0')
|
56
55
|
end
|
57
56
|
|
58
|
-
def auth
|
59
|
-
load_auth_from_file
|
60
|
-
end
|
61
|
-
|
62
57
|
def initialize(options = {})
|
63
58
|
@logger = Logger.new($stdout)
|
64
59
|
logger.level = options[:log_level] || Logger::INFO
|
@@ -112,9 +107,11 @@ module Convox
|
|
112
107
|
'AWS_ACCESS_KEY_ID' => config.fetch(:aws_access_key_id),
|
113
108
|
'AWS_SECRET_ACCESS_KEY' => config.fetch(:aws_secret_access_key)
|
114
109
|
}
|
110
|
+
# Set proxy_protocol=true by default to forward client IPs
|
115
111
|
command = %(rack install aws \
|
116
112
|
"#{config.fetch(:stack_name)}" \
|
117
113
|
"node_type=#{config.fetch(:instance_type)}" \
|
114
|
+
"proxy_protocol=true" \
|
118
115
|
"region=#{config.fetch(:aws_region)}")
|
119
116
|
# us-east constantly has problems with the us-east-1c AZ:
|
120
117
|
# "Cannot create cluster 'ds-enterprise-cx3' because us-east-1c, the targeted
|
@@ -130,16 +127,8 @@ module Convox
|
|
130
127
|
|
131
128
|
def rack_already_installed?
|
132
129
|
require_config(%i[aws_region stack_name])
|
133
|
-
|
134
|
-
return unless File.exist?(AUTH_FILE)
|
135
|
-
|
136
|
-
# region = config.fetch(:aws_region)
|
137
|
-
stack_name = config.fetch(:stack_name)
|
138
130
|
return true if File.exist?(rack_dir)
|
139
131
|
|
140
|
-
auth.each do |rack_name, _password|
|
141
|
-
return true if rack_name == stack_name
|
142
|
-
end
|
143
132
|
false
|
144
133
|
end
|
145
134
|
|
@@ -441,16 +430,6 @@ module Convox
|
|
441
430
|
|
442
431
|
private
|
443
432
|
|
444
|
-
def load_auth_from_file
|
445
|
-
return {} unless File.exist?(AUTH_FILE)
|
446
|
-
|
447
|
-
begin
|
448
|
-
JSON.parse(File.read(AUTH_FILE))
|
449
|
-
rescue StandardError
|
450
|
-
{}
|
451
|
-
end
|
452
|
-
end
|
453
|
-
|
454
433
|
def require_config(required_keys)
|
455
434
|
required_keys.each do |k|
|
456
435
|
raise "#{k} is missing from the config!" unless config[k]
|
@@ -5,15 +5,6 @@ require 'convox/client'
|
|
5
5
|
RSpec.describe Convox::Client do
|
6
6
|
let(:home_dir) { File.expand_path('~') }
|
7
7
|
|
8
|
-
it 'finds the authentication details in ~/.convox/auth' do
|
9
|
-
expect(File).to receive(:exist?).with("#{home_dir}/.convox/auth").and_return(true)
|
10
|
-
expect(File).to receive(:read).with("#{home_dir}/.convox/auth").and_return(
|
11
|
-
'{ "test.example.com": "1234567890" }'
|
12
|
-
)
|
13
|
-
client = described_class.new
|
14
|
-
expect(client.auth).to eq('test.example.com' => '1234567890')
|
15
|
-
end
|
16
|
-
|
17
8
|
describe 'Convox CLI version' do
|
18
9
|
let(:client) { described_class.new }
|
19
10
|
|
@@ -100,91 +91,12 @@ RSpec.describe Convox::Client do
|
|
100
91
|
end
|
101
92
|
end
|
102
93
|
|
103
|
-
describe '#
|
94
|
+
describe '#validate_convox_rack_and_write_current!' do
|
104
95
|
it 'requires the correct config vars' do
|
105
96
|
client = described_class.new
|
106
97
|
expect do
|
107
|
-
client.
|
98
|
+
client.validate_convox_rack_and_write_current!
|
108
99
|
end.to raise_error('aws_region is missing from the config!')
|
109
100
|
end
|
110
|
-
|
111
|
-
it 'raises an error if auth file is missing' do
|
112
|
-
client = described_class.new(
|
113
|
-
config: {
|
114
|
-
aws_region: 'us-east-1',
|
115
|
-
stack_name: 'asdf'
|
116
|
-
}
|
117
|
-
)
|
118
|
-
expect(File).to receive(:exist?).with(
|
119
|
-
"#{home_dir}/.convox/auth"
|
120
|
-
).and_return(false)
|
121
|
-
|
122
|
-
expect do
|
123
|
-
client.validate_convox_auth_and_write_host!
|
124
|
-
end.to raise_error(/Could not find auth file at /)
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'sets ~/.convox/host if a matching host is found in the auth file' do
|
128
|
-
expect(File).to receive(:exist?).with(
|
129
|
-
"#{home_dir}/.convox/auth"
|
130
|
-
).twice.and_return(true)
|
131
|
-
|
132
|
-
expect(File).to receive(:read).with("#{home_dir}/.convox/auth").and_return(
|
133
|
-
'{ "convox-test-697645520.us-west-2.elb.amazonaws.com": "1234567890" }'
|
134
|
-
)
|
135
|
-
client = described_class.new(
|
136
|
-
config: {
|
137
|
-
aws_region: 'us-west-2',
|
138
|
-
stack_name: 'convox-test'
|
139
|
-
}
|
140
|
-
)
|
141
|
-
expect(client).to receive(:write_current).with(
|
142
|
-
'convox-test-697645520.us-west-2.elb.amazonaws.com'
|
143
|
-
)
|
144
|
-
expect(client.validate_convox_auth_and_write_host!).to(
|
145
|
-
eq('convox-test-697645520.us-west-2.elb.amazonaws.com')
|
146
|
-
)
|
147
|
-
end
|
148
|
-
|
149
|
-
it 'raises an error if no matching host is found' do
|
150
|
-
expect(File).to receive(:exist?).with(
|
151
|
-
"#{home_dir}/.convox/auth"
|
152
|
-
).twice.and_return(true)
|
153
|
-
|
154
|
-
expect(File).to receive(:read).with("#{home_dir}/.convox/auth").and_return(
|
155
|
-
'{ "convox-test-697645520.us-west-2.elb.amazonaws.com": "1234567890" }'
|
156
|
-
)
|
157
|
-
client = described_class.new(
|
158
|
-
config: {
|
159
|
-
aws_region: 'us-east-1',
|
160
|
-
stack_name: 'convox-test'
|
161
|
-
}
|
162
|
-
)
|
163
|
-
expect do
|
164
|
-
client.validate_convox_auth_and_write_host!
|
165
|
-
end.to raise_error('Could not find matching authentication for ' \
|
166
|
-
'region: us-east-1, stack: convox-test')
|
167
|
-
end
|
168
|
-
|
169
|
-
it 'raises an error if it finds multiple matching hosts' do
|
170
|
-
expect(File).to receive(:exist?).with(
|
171
|
-
"#{home_dir}/.convox/auth"
|
172
|
-
).twice.and_return(true)
|
173
|
-
|
174
|
-
expect(File).to receive(:read).with("#{home_dir}/.convox/auth").and_return(
|
175
|
-
'{ "convox-test-697645520.us-west-2.elb.amazonaws.com": "1234567890", ' \
|
176
|
-
'"convox-test-1234123412.us-west-2.elb.amazonaws.com": "1234567890" }'
|
177
|
-
)
|
178
|
-
client = described_class.new(
|
179
|
-
config: {
|
180
|
-
aws_region: 'us-west-2',
|
181
|
-
stack_name: 'convox-test'
|
182
|
-
}
|
183
|
-
)
|
184
|
-
expect do
|
185
|
-
client.validate_convox_auth_and_write_host!
|
186
|
-
end.to raise_error('Found multiple matching hosts for ' \
|
187
|
-
'region: us-west-2, stack: convox-test')
|
188
|
-
end
|
189
101
|
end
|
190
102
|
end
|
data/terraform/rds.tf.erb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
resource "aws_db_instance" "rds_database" {
|
2
2
|
allocated_storage = <%= config[:database_allocated_storage] || 30 %>
|
3
3
|
engine = "<%= config[:database_engine] || 'postgres' %>"
|
4
|
-
engine_version = "<%= config[:database_engine_version] || '14.
|
5
|
-
instance_class = "<%= config[:database_instance_class] || 'db.t3.
|
4
|
+
engine_version = "<%= config[:database_engine_version] || '14.8' %>"
|
5
|
+
instance_class = "<%= config[:database_instance_class] || 'db.t3.small' %>"
|
6
6
|
name = "<%= config.fetch(:stack_name).gsub('-', '_') %>_database"
|
7
7
|
identifier = "<%= config.fetch(:stack_name) %>-rds-<%= config.fetch(:random_id) %>"
|
8
8
|
multi_az = <%= config[:database_multi_az] || true %>
|
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: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- DocSpring, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
version: 1.0.1
|
83
83
|
description: Build a Convox installation workflow
|
84
84
|
email:
|
85
|
-
- support@
|
85
|
+
- support@docspring.com
|
86
86
|
executables: []
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
@@ -112,7 +112,7 @@ files:
|
|
112
112
|
- terraform/elasticache.tf.erb
|
113
113
|
- terraform/rds.tf.erb
|
114
114
|
- terraform/s3_bucket.tf.erb
|
115
|
-
homepage: https://github.com/
|
115
|
+
homepage: https://github.com/DocSpring/convox_installer
|
116
116
|
licenses:
|
117
117
|
- MIT
|
118
118
|
metadata:
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.1.6
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Build a Convox installation workflow
|