elastic-beanstalk 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +134 -128
- data/elastic-beanstalk.gemspec +1 -1
- data/lib/elastic/beanstalk/tasks/eb.rake +9 -4
- data/lib/elastic/beanstalk/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78b136f50127269176467ba6b9acc6f6e66ecd68
|
4
|
+
data.tar.gz: 5f2ee1c26fadeccb7e900ba5f3113382532e05a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83d030e7f06d67f9fea40967532393e09782d759fbce5fbf30b1edddae842fb8200a2383f2739032f421921cf5c9bff44767ba1c4872c7c17c05860f44b47ace
|
7
|
+
data.tar.gz: 02409b252a1f8dd08f103f189144744ef67376cb738acd75ac389f3e263e3a19a3f08c33e3c3ee043fe155b7d3a37a1f21e9ea768bedf3cc9ebbcdb0486787e8
|
data/README.md
CHANGED
@@ -46,21 +46,23 @@ This should contain the access and secret keys generated from the selected IAM u
|
|
46
46
|
### Step 2. Add a config/eb.yml to your rails project
|
47
47
|
Something like this should get you started
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
```ruby
|
50
|
+
app: acme
|
51
|
+
region: us-east-1
|
52
|
+
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html
|
53
|
+
solution_stack_name: 64bit Amazon Linux 2013.09 running Ruby 1.9.3
|
54
|
+
|
55
|
+
development:
|
56
|
+
strategy: inplace_update
|
57
|
+
options:
|
58
|
+
aws:autoscaling:launchconfiguration:
|
59
|
+
InstanceType: t1.micro
|
60
|
+
|
61
|
+
production:
|
62
|
+
options:
|
63
|
+
aws:autoscaling:launchconfiguration:
|
64
|
+
InstanceType: t1.small
|
65
|
+
```
|
64
66
|
|
65
67
|
### Step 3. Package and deploy
|
66
68
|
The default is the 'development' environment, change this via command line arguments
|
@@ -131,129 +133,133 @@ Deploy an MD5 hashed version of acme to development
|
|
131
133
|
|
132
134
|
config/eb.yml
|
133
135
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
136
|
+
```ruby
|
137
|
+
# This is a sample that has not been executed so it may not be exactly 100%, but is intended to show
|
138
|
+
# that access to full options_settings and .ebextensions is intended.
|
139
|
+
#---
|
140
|
+
app: acme
|
141
|
+
region: us-east-1
|
142
|
+
solution_stack_name: 64bit Amazon Linux running Ruby 1.9.3
|
143
|
+
package:
|
144
|
+
verbose: true
|
145
|
+
exclude_dirs: [solr, features] # additional dirs that merge with default excludes
|
146
|
+
exclude_files: [rspec.xml, README*, db/*.sqlite3]
|
147
|
+
smoke_test: |
|
148
|
+
lambda { |host|
|
149
|
+
EbSmokeTester.test_url("http://#{host}/ping", 600, 5, 'All good! Everything is up and checks out.')
|
150
|
+
}
|
151
|
+
#--
|
152
|
+
ebextensions:
|
153
|
+
01settings.config:
|
154
|
+
# Run rake tasks before an application deployment
|
155
|
+
container_commands:
|
156
|
+
01seed:
|
157
|
+
command: rake db:seed
|
158
|
+
leader_only: true
|
159
|
+
# run any necessary commands
|
160
|
+
02commands.config:
|
161
|
+
container_commands:
|
162
|
+
01timezone:
|
163
|
+
command: "ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime"
|
164
|
+
|
165
|
+
# These are things that make sense for any Ruby application see:
|
166
|
+
# https://github.com/gkop/elastic-beanstalk-ruby/blob/master/.ebextensions/ruby.config
|
167
|
+
03-ruby.config:
|
168
|
+
|
169
|
+
# Install git in order to be able to bundle gems from git
|
170
|
+
packages:
|
171
|
+
yum:
|
172
|
+
git: []
|
173
|
+
commands:
|
174
|
+
# Run rake with bundle exec to be sure you get the right version
|
175
|
+
add_bundle_exec:
|
176
|
+
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
|
177
|
+
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
|
178
|
+
command: perl -pi -e 's/(rake)/bundle exec $1/' 11_asset_compilation.sh 12_db_migration.sh
|
179
|
+
# Bundle with --deployment as recommended by bundler docs
|
180
|
+
# cf. http://gembundler.com/v1.2/rationale.html under Deploying Your Application
|
181
|
+
add_deployment_flag:
|
182
|
+
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
|
183
|
+
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
|
184
|
+
command: perl -pi -e 's/(bundle install)/$1 --deployment/' 10_bundle_install.sh
|
185
|
+
# Vendor gems to a persistent directory for speedy subsequent bundling
|
186
|
+
make_vendor_bundle_dir:
|
187
|
+
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
|
188
|
+
command: mkdir /var/app/support/vendor_bundle
|
189
|
+
# Store the location of vendored gems in a handy env var
|
190
|
+
set_vendor_bundle_var:
|
191
|
+
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
|
192
|
+
cwd: /opt/elasticbeanstalk/support
|
193
|
+
command: sed -i '12iexport EB_CONFIG_APP_VENDOR_BUNDLE=$EB_CONFIG_APP_SUPPORT/vendor_bundle' envvars
|
194
|
+
# The --deployment flag tells bundler to install gems to vendor/bundle/, so
|
195
|
+
# symlink that to the persistent directory
|
196
|
+
symlink_vendor_bundle:
|
197
|
+
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
|
198
|
+
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
|
199
|
+
command: sed -i '6iln -s $EB_CONFIG_APP_VENDOR_BUNDLE ./vendor/bundle' 10_bundle_install.sh
|
200
|
+
# Don't run the above commands again on this instance
|
201
|
+
# cf. http://stackoverflow.com/a/16846429/283398
|
202
|
+
z_write_post_provisioning_complete_file:
|
203
|
+
cwd: /opt/elasticbeanstalk/support
|
204
|
+
command: touch .post-provisioning-complete
|
205
|
+
#---
|
206
|
+
options:
|
207
|
+
aws:autoscaling:launchconfiguration:
|
208
|
+
EC2KeyName: eb-ssh
|
209
|
+
SecurityGroups: 'acme-production-control'
|
210
|
+
|
211
|
+
aws:autoscaling:asg:
|
212
|
+
MinSize: 1
|
213
|
+
MaxSize: 5
|
214
|
+
|
215
|
+
aws:elb:loadbalancer:
|
216
|
+
SSLCertificateId: 'arn:aws:iam::XXXXXXX:server-certificate/acme'
|
217
|
+
LoadBalancerHTTPSPort: 443
|
218
|
+
|
219
|
+
aws:elb:policies:
|
220
|
+
Stickiness Policy: true
|
221
|
+
|
222
|
+
aws:elasticbeanstalk:sns:topics:
|
223
|
+
Notification Endpoint: 'alerts@acme.com'
|
224
|
+
|
225
|
+
aws:elasticbeanstalk:application:
|
226
|
+
Application Healthcheck URL: '/'
|
227
|
+
#---
|
228
|
+
development:
|
229
|
+
strategy: inplace_update
|
230
|
+
options:
|
231
|
+
aws:autoscaling:launchconfiguration:
|
232
|
+
InstanceType: t1.micro
|
233
|
+
aws:elasticbeanstalk:application:environment:
|
234
|
+
RAILS_SKIP_ASSET_COMPILATION: true
|
235
|
+
#---
|
236
|
+
production:
|
237
|
+
options:
|
238
|
+
aws:autoscaling:launchconfiguration:
|
239
|
+
InstanceType: t1.small
|
240
|
+
```
|
239
241
|
|
240
242
|
## Additional options
|
241
243
|
Most of the configurations are defaulted. The following are less obvious but may be useful:
|
242
244
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
245
|
+
```ruby
|
246
|
+
secrets_dir: (default: '~/.aws')
|
247
|
+
package:
|
248
|
+
verbose: (default: false)
|
249
|
+
dir: (default: 'pkg')
|
250
|
+
```
|
247
251
|
|
248
252
|
### eb_deployer additional options
|
249
253
|
The following are passed if not nil, otherwise eb_deployer assigns an appropriate default.
|
250
254
|
|
251
|
-
|
252
|
-
|
253
|
-
|
255
|
+
```ruby
|
256
|
+
package_bucket:
|
257
|
+
keep_latest:
|
258
|
+
version_prefix:
|
259
|
+
```
|
254
260
|
|
255
261
|
## Still to come
|
256
|
-
1. Caching sample config
|
262
|
+
1. Caching sample config?
|
257
263
|
2. More thorough access to the Elastic Beanstalk api as-needed.
|
258
264
|
|
259
265
|
## Contributing
|
data/elastic-beanstalk.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
|
33
33
|
# runtime
|
34
34
|
s.add_runtime_dependency 'railties', '>= 3.2'
|
35
|
-
s.add_runtime_dependency 'eb_deployer', '>= 0.
|
35
|
+
s.add_runtime_dependency 'eb_deployer', '>= 0.6.1'
|
36
36
|
s.add_runtime_dependency 'awesome_print'
|
37
37
|
s.add_runtime_dependency 'time_diff'
|
38
38
|
s.add_runtime_dependency 'rubyzip'
|
@@ -68,11 +68,11 @@ namespace :eb do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def snapshot(snapshot_id)
|
71
|
-
|
71
|
+
Aws::RDS::DBSnapshot.new(snapshot_id)
|
72
72
|
end
|
73
73
|
|
74
74
|
def db(instance_id)
|
75
|
-
db_instance =
|
75
|
+
db_instance = Aws::RDS::DBInstance.new(instance_id)
|
76
76
|
raise "DB Instance[#{instance_id}] does not exist." unless db_instance.exists?
|
77
77
|
db_instance
|
78
78
|
end
|
@@ -181,11 +181,16 @@ namespace :eb do
|
|
181
181
|
|
182
182
|
#-------------------------------------------------------------------------------
|
183
183
|
# configure aws credentials. Depending on the called task, this may not be necessary parent task should call #credentials! for validation.
|
184
|
-
|
184
|
+
Aws.config.update({
|
185
|
+
credentials: Aws::Credentials.new(credentials['access_key_id'], credentials['secret_access_key']),
|
186
|
+
}) unless credentials.nil?
|
185
187
|
|
186
188
|
#-------------------------------------------------------------------------------
|
187
189
|
# configure aws region if specified in the eb.yml
|
188
|
-
|
190
|
+
Aws.config.update({
|
191
|
+
region: EbConfig.region,
|
192
|
+
}) unless EbConfig.region.nil?
|
193
|
+
|
189
194
|
end
|
190
195
|
|
191
196
|
###########################################
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-beanstalk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Ross
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.6.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.6.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: awesome_print
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|