-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all EB documentation to .ebextensions/README.md.
- Loading branch information
1 parent
1eb3283
commit e335433
Showing
2 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,53 @@ | ||
When selecting Ruby as the platform, EB sets these initial variables: | ||
# Initial setup | ||
|
||
If you are using the free tier, then use a t2.micro instance. If not, you can use a t1.micro with spot to get the lowest price. | ||
|
||
Create environment: | ||
``` | ||
git tag -a -m "First deploy" eb-v1 | ||
eb init rssbox --platform "Ruby 2.6 (Puma)" --keyname id_rsa | ||
eb create --single --instance_type t2.micro | ||
``` | ||
|
||
For spot: | ||
``` | ||
eb create --single --instance_type t1.micro --envvars EC2_SPOT_PRICE=0.01 | ||
``` | ||
|
||
With a load balancer: | ||
``` | ||
eb create --instance_type t2.micro --elb-type application --envvars ASG_HEALTH_CHECK_TYPE=ELB | ||
``` | ||
|
||
When selecting Ruby as the platform, the following variables are automatically set: | ||
- `BUNDLE_WITHOUT=test:development` | ||
- `RACK_ENV=production` (this is why the app still has to default `APP_ENV` to `RACK_ENV`) | ||
- `RAILS_SKIP_ASSET_COMPILATION=false` | ||
- `RAILS_SKIP_MIGRATIONS=false` | ||
|
||
Logs on the instances are available at: | ||
- `/var/log/puma/puma.log` | ||
# Deploy | ||
|
||
While testing, it is a lot faster to deploy if there is only one instance running. | ||
Deploy with: | ||
``` | ||
eb deploy --staged | ||
``` | ||
|
||
To export a deployable zip, use: | ||
``` | ||
git archive --format zip -9 -o rssbox.zip HEAD | ||
``` | ||
|
||
While testing, it is a lot faster to deploy if there is only one instance running. | ||
|
||
# Upgrade major Ruby version | ||
|
||
To upgrade an existing app to a new major version of Ruby: | ||
``` | ||
aws elasticbeanstalk list-available-solution-stacks --query SolutionStacks | ||
aws elasticbeanstalk update-environment --region us-west-2 --environment-name rssbox --solution-stack-name "64bit Amazon Linux 2018.03 v2.9.1 running Ruby 2.6 (Puma)" | ||
``` | ||
|
||
# Misc | ||
|
||
Logs on the instances are available at: | ||
- `/var/log/puma/puma.log` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters