Skip to content

Commit

Permalink
Move all EB documentation to .ebextensions/README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Mar 20, 2019
1 parent 1eb3283 commit e335433
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
40 changes: 36 additions & 4 deletions .ebextensions/README.md
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`
26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,7 @@ You can use this app freely at [rssbox.herokuapp.com](https://rssbox.herokuapp.c

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/stefansundin/rssbox)

### Elastic Beanstalk

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.5 (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
```

Deploy with:
```
eb deploy --staged
```
To deploy to Elastic Beanstalk, see [.ebextensions/README.md](.ebextensions/README.md).

### Configuration

Expand Down

0 comments on commit e335433

Please sign in to comment.