aws-rails-provisioner 0.0.1.rc2 → 0.0.2.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aws-rails-provisioner +1 -1
- data/lib/aws-rails-provisioner/cdk_builder.rb +2 -1
- data/lib/aws-rails-provisioner/cdk_deployer.rb +1 -0
- data/lib/aws-rails-provisioner/db_cluster.rb +7 -7
- data/lib/aws-rails-provisioner/migration.rb +2 -2
- data/lib/aws-rails-provisioner/services.rb +5 -5
- data/lib/aws-rails-provisioner/views/fargate_stack.rb +0 -1
- data/templates/fargate_stack.mustache +4 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17ab168eeba12cb5e76d72c022269197cefe803e19515505473e4ee8219ac82a
|
4
|
+
data.tar.gz: eb63e2b7c14980ae96b06cc3150cdba437132ff9810604265954119d668eb778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5233a25be1e789b27ae1c5df94b45b0aa43c3de87810912fdb4a1b51e2b523e3ee61d030fa24764dfd91e5972343bc2dd9745d3ca4d63e32b138598a9a697647
|
7
|
+
data.tar.gz: ea96c05133c12dd45f3aa00b2142d121468b456dfbd75164f504153a81a5548397f577398ba7ae08e7c21114606ba0f2f56710a75c4be061205835e5d0364250
|
data/bin/aws-rails-provisioner
CHANGED
@@ -125,7 +125,7 @@ elsif options[:deploy]
|
|
125
125
|
service_name: options[:service_name]
|
126
126
|
}
|
127
127
|
if options[:profile]
|
128
|
-
deploy_params[:profile] = profile
|
128
|
+
deploy_params[:profile] = options[:profile]
|
129
129
|
end
|
130
130
|
deploy_params.merge!(options[:deploy])
|
131
131
|
deployer = Aws::RailsProvisioner::CDKDeployer.new(deploy_params)
|
@@ -56,6 +56,7 @@ module Aws::RailsProvisioner
|
|
56
56
|
end
|
57
57
|
Dir.chdir(@cdk_dir) do
|
58
58
|
pkgs.each do |pkg|
|
59
|
+
puts "installing pkg: #{pkg} ..."
|
59
60
|
`npm install #{pkg}`
|
60
61
|
end
|
61
62
|
end
|
@@ -64,7 +65,7 @@ module Aws::RailsProvisioner
|
|
64
65
|
def _npm_build
|
65
66
|
Dir.chdir(@cdk_dir) do
|
66
67
|
puts "running npm run build ..."
|
67
|
-
`npm run build`
|
68
|
+
`npm run build --verbose`
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'aws-sdk-rds'
|
2
2
|
|
3
|
-
module Aws::RailsProvisioner
|
3
|
+
module Aws::RailsProvisioner
|
4
4
|
class DBCluster
|
5
5
|
|
6
6
|
# Configuration value under :db_cluster
|
@@ -59,9 +59,9 @@ module Aws::RailsProvisioner
|
|
59
59
|
#
|
60
60
|
# @example: at `aws-rails-provisioner.yml`
|
61
61
|
# parameter_group:
|
62
|
-
# family: 'aurora-
|
62
|
+
# family: 'aurora-postgresql11'
|
63
63
|
# description: 'created by AWS RailsProvisioner'
|
64
|
-
# parameters:
|
64
|
+
# parameters:
|
65
65
|
# key: value
|
66
66
|
# @see {Aws::RailsProvisioner::DBCluster::ParameterGroup}
|
67
67
|
#
|
@@ -178,7 +178,7 @@ module Aws::RailsProvisioner
|
|
178
178
|
end
|
179
179
|
|
180
180
|
class ParameterGroup
|
181
|
-
|
181
|
+
|
182
182
|
# @param [Hash] options
|
183
183
|
#
|
184
184
|
# @option options [String] :family
|
@@ -223,7 +223,7 @@ module Aws::RailsProvisioner
|
|
223
223
|
|
224
224
|
def _default_family
|
225
225
|
case @engine
|
226
|
-
when 'AURORA_POSTGRESQL' then 'aurora-
|
226
|
+
when 'AURORA_POSTGRESQL' then 'aurora-postgresql11'
|
227
227
|
when 'AURORA_MYSQL' then 'aurora-mysql5.7'
|
228
228
|
when 'AURORA' then 'aurora5.6'
|
229
229
|
else
|
@@ -277,7 +277,7 @@ module Aws::RailsProvisioner
|
|
277
277
|
when 'AURORA' then 'r5.large'
|
278
278
|
else
|
279
279
|
msg = 'Failed to locate a default instance type for :engine'\
|
280
|
-
' provided, please provide :instance_type'
|
280
|
+
' provided, please provide :instance_type'
|
281
281
|
raise Aws::RailsProvisioner::Errors::ValidationError, msg
|
282
282
|
end
|
283
283
|
end
|
@@ -289,7 +289,7 @@ module Aws::RailsProvisioner
|
|
289
289
|
when 'AURORA' then 3306
|
290
290
|
else
|
291
291
|
msg = 'Failed to locate a default db port for :engine'\
|
292
|
-
' provided, please provide :port'
|
292
|
+
' provided, please provide :port'
|
293
293
|
raise Aws::RailsProvisioner::Errors::ValidationError, msg
|
294
294
|
end
|
295
295
|
|
@@ -20,7 +20,7 @@ module Aws::RailsProvisioner
|
|
20
20
|
# to `buildspec-db.yml` under root directory, using template under
|
21
21
|
# `buildspecs/`
|
22
22
|
#
|
23
|
-
# @option options [String] :build_image default to codebuild `
|
23
|
+
# @option options [String] :build_image default to codebuild `standard_4_0`
|
24
24
|
# full list of supported images see:
|
25
25
|
# https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.LinuxBuildImage.html
|
26
26
|
#
|
@@ -36,7 +36,7 @@ module Aws::RailsProvisioner
|
|
36
36
|
options[:buildspec] = 'buildspec-db.yml'
|
37
37
|
end
|
38
38
|
unless options[:build_image]
|
39
|
-
options[:build_image] = '
|
39
|
+
options[:build_image] = 'standard_4_0'
|
40
40
|
end
|
41
41
|
# TODO envs support?
|
42
42
|
super(options)
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module Aws::RailsProvisioner
|
2
2
|
# @api private
|
3
3
|
class ServiceEnumerator
|
4
|
-
|
4
|
+
|
5
5
|
include Enumerable
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
|
-
@configs = options || {}
|
8
|
+
@configs = options || {}
|
9
9
|
end
|
10
10
|
|
11
|
-
# @param [String] name
|
11
|
+
# @param [String] name
|
12
12
|
def [](name)
|
13
13
|
if services.key?(name)
|
14
14
|
services[name]
|
15
15
|
else
|
16
|
-
msg = "unknown service #{
|
17
|
-
raise Aws::RailsProvisioner::ValidationError, msg
|
16
|
+
msg = "unknown service #{name} under :services"
|
17
|
+
raise Aws::RailsProvisioner::Errors::ValidationError, msg
|
18
18
|
end
|
19
19
|
end
|
20
20
|
alias service []
|
@@ -45,7 +45,6 @@ module Aws::RailsProvisioner
|
|
45
45
|
base = [
|
46
46
|
{ abbr: 'ec2', value: 'ec2' },
|
47
47
|
{ abbr: 'ecs', value: 'ecs' },
|
48
|
-
{ abbr: 'ecr', value: 'ecr' },
|
49
48
|
{ abbr: 'ecs_patterns', value: 'ecs-patterns' },
|
50
49
|
{ abbr: 'ecr_assets', value: 'ecr-assets' },
|
51
50
|
{ abbr: 'rds', value: 'rds' }
|
@@ -93,7 +93,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
|
|
93
93
|
instances: {{instances}},
|
94
94
|
parameterGroup: clusterParameterGroup
|
95
95
|
});
|
96
|
-
const dbUrl = {{#postgres}}"postgres://"{{/postgres}}{{^postgres}}"mysql2://"{{/postgres}} + username + ":" + password + "@" + db.clusterEndpoint.socketAddress;
|
96
|
+
const dbUrl = {{#postgres}}"postgres://"{{/postgres}}{{^postgres}}"mysql2://"{{/postgres}} + username + ":" + password + "@" + db.clusterEndpoint.socketAddress + "/{{db_name}}";
|
97
97
|
this.dbUrl = dbUrl;
|
98
98
|
{{/db_cluster}}
|
99
99
|
|
@@ -106,8 +106,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
|
|
106
106
|
const repoName = parts.slice(1, parts.length).join("/").split(":")[0];
|
107
107
|
this.repoName = repoName;
|
108
108
|
|
109
|
-
const
|
110
|
-
const image = ecs.ContainerImage.fromEcrRepository(ecrRepo);
|
109
|
+
const image = ecs.ContainerImage.fromDockerImageAsset(asset);
|
111
110
|
|
112
111
|
{{#fargate}}
|
113
112
|
// Fargate service
|
@@ -122,7 +121,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
|
|
122
121
|
containerPort: {{container_port}},
|
123
122
|
environment: {
|
124
123
|
{{#has_db}}
|
125
|
-
'DATABASE_URL': dbUrl,
|
124
|
+
'DATABASE_URL': dbUrl,
|
126
125
|
{{/has_db}}
|
127
126
|
{{#envs}}
|
128
127
|
{{{.}}}
|
@@ -241,7 +240,7 @@ export class {{stack_prefix}}FargateStack extends cdk.Stack {
|
|
241
240
|
{{/on_metric}}
|
242
241
|
{{#on_request}}
|
243
242
|
scaling.scaleOnRequestCount('FargateScalingOnRequest', {
|
244
|
-
requestsPerTarget: {{requests_per_target}},
|
243
|
+
requestsPerTarget: {{requests_per_target}},
|
245
244
|
targetGroup: target,
|
246
245
|
{{#disable_scale_in}}
|
247
246
|
disableScaleIn: true,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-rails-provisioner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-rds
|