inf 0.0.14 → 0.0.15
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/bin/inf +0 -1
- data/lib/aws.rb +26 -20
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0590efc3175a008573b3d56833eea841415dc46
|
|
4
|
+
data.tar.gz: 34fd31eb23ba83cd6c35310ec192e52cda63fd12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0562297b95f3734508a6c32c6bf950be22db7981c1d932509dfc7842287f9371d107d5ee5edb56768fe80f34e48793339fd9dbae56354203e1bab9f4bd67c5d
|
|
7
|
+
data.tar.gz: 2b297e1ed43d694b6399c5c5cfdc548b6df7df4467f28cc7982c39d3a70fe8226aee7d9257b2dae480cddb7c34ce861a8067a2139c7c0e02a4e9d56c1085cdbe
|
data/bin/inf
CHANGED
data/lib/aws.rb
CHANGED
|
@@ -30,7 +30,7 @@ export APP_NAME=#{app_name}
|
|
|
30
30
|
export STATE_BUCKET=#{state_bucket}
|
|
31
31
|
export FLEET_NAME=#{fleet_name}
|
|
32
32
|
export AWS_REGION=#{ENV['AWS_REGION']}
|
|
33
|
-
export JENKINS_PUBLIC_KEY=
|
|
33
|
+
export JENKINS_PUBLIC_KEY='#{ENV['JENKINS_PUBLIC_KEY']}'
|
|
34
34
|
EOF
|
|
35
35
|
|
|
36
36
|
. ./bootstrap-env
|
|
@@ -45,23 +45,29 @@ BOOTSTRAP_SCRIPT
|
|
|
45
45
|
|
|
46
46
|
def self.launch_load_balancer
|
|
47
47
|
lb_name = "app-lb-#{app_name}"
|
|
48
|
+
cert = ENV['CERT_ARN']
|
|
49
|
+
|
|
50
|
+
listeners = [{
|
|
51
|
+
instance_port: 5000,
|
|
52
|
+
instance_protocol: 'HTTP',
|
|
53
|
+
load_balancer_port: 80,
|
|
54
|
+
protocol: 'HTTP'
|
|
55
|
+
}]
|
|
56
|
+
|
|
57
|
+
cert.present? && listeners.push(
|
|
58
|
+
instance_port: 5000,
|
|
59
|
+
instance_protocol: 'HTTP',
|
|
60
|
+
load_balancer_port: 443,
|
|
61
|
+
protocol: 'HTTPS',
|
|
62
|
+
ssl_certificate_id: cert
|
|
63
|
+
)
|
|
64
|
+
|
|
48
65
|
lb_dns = elb.create_load_balancer(
|
|
49
66
|
load_balancer_name: lb_name,
|
|
50
67
|
subnets: ENV['SUBNET_IDS'].split(','),
|
|
51
68
|
security_groups: [ENV['ELB_SG']],
|
|
52
|
-
scheme:
|
|
53
|
-
listeners:
|
|
54
|
-
instance_port: 5000,
|
|
55
|
-
instance_protocol: 'HTTP',
|
|
56
|
-
load_balancer_port: 80,
|
|
57
|
-
protocol: 'HTTP'
|
|
58
|
-
}, {
|
|
59
|
-
instance_port: 5000,
|
|
60
|
-
instance_protocol: "HTTP",
|
|
61
|
-
load_balancer_port: 443,
|
|
62
|
-
protocol: "HTTPS",
|
|
63
|
-
ssl_certificate_id: ENV['CERT_ARN'],
|
|
64
|
-
}]
|
|
69
|
+
scheme: 'internet-facing',
|
|
70
|
+
listeners: listeners
|
|
65
71
|
).dns_name
|
|
66
72
|
|
|
67
73
|
elb.configure_health_check(
|
|
@@ -78,7 +84,7 @@ BOOTSTRAP_SCRIPT
|
|
|
78
84
|
put_state("apps/#{app_name}/lb-name", lb_name)
|
|
79
85
|
put_state("apps/#{app_name}/lb-dns", lb_dns)
|
|
80
86
|
|
|
81
|
-
puts
|
|
87
|
+
puts 'Launched load balancer (or it was running)'.blue
|
|
82
88
|
end
|
|
83
89
|
|
|
84
90
|
def self.request_spot_fleet(fleet_name='default')
|
|
@@ -109,10 +115,10 @@ BOOTSTRAP_SCRIPT
|
|
|
109
115
|
|
|
110
116
|
tag_specifications = [{
|
|
111
117
|
tags: [{
|
|
112
|
-
key:
|
|
118
|
+
key: 'app_name',
|
|
113
119
|
value: app_name
|
|
114
120
|
}, {
|
|
115
|
-
key:
|
|
121
|
+
key: 'fleet_name',
|
|
116
122
|
value: fleet_name
|
|
117
123
|
}]
|
|
118
124
|
}]
|
|
@@ -127,9 +133,9 @@ BOOTSTRAP_SCRIPT
|
|
|
127
133
|
iam_fleet_role: ENV['FLEET_ROLE'],
|
|
128
134
|
launch_specifications: launch_specifications,
|
|
129
135
|
# tag_specifications: tag_specifications,
|
|
130
|
-
excess_capacity_termination_policy:
|
|
131
|
-
allocation_strategy:
|
|
132
|
-
type:
|
|
136
|
+
excess_capacity_termination_policy: 'default', # accepts noTermination, default
|
|
137
|
+
allocation_strategy: 'diversified', # accepts lowestPrice, diversified
|
|
138
|
+
type: 'maintain', # accepts request, maintain
|
|
133
139
|
replace_unhealthy_instances: true,
|
|
134
140
|
},
|
|
135
141
|
)
|
data/lib/version.rb
CHANGED