Skip to content

Commit 3282217

Browse files
authored
Merge pull request #869 from DFE-Digital/explicitly-set-buildpacks-in-heroku
Update Heroku configuration to enable acceptance testing apps
2 parents c55c46e + dcd5f7c commit 3282217

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
web: bin/rails server -p $PORT -e $RAILS_ENV
22
worker: bundle exec rake jobs:work
3-
release: rake db:migrate
3+
postdeploy: bundle exec rake db:migrate

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ Development is automatically built and deployed when commits are pushed to
200200
The release process for Production is documented in
201201
[`docs/release-process.md`](docs/release-process.md)
202202

203+
### Heroku Review Apps
204+
205+
Pull requests in the
206+
[GitHub Repository](https://github.com/DFE-Digital/dfe-teachers-payment-service)
207+
will automatically have a
208+
[review app](https://devcenter.heroku.com/articles/github-integration-review-apps)
209+
created in Heroku once CI has passed.
210+
211+
For more information, see the [app's Heroku docs](docs/heroku.md)
212+
203213
## Accessing production data with a live Rails console
204214

205215
**Accessing a live console is very risky and should only be done as a last

app.json

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
22
"environments": {
3+
"review": {
4+
"addons": ["heroku-postgresql:in-dyno"],
5+
"buildpacks": [
6+
{ "url": "heroku/nodejs" },
7+
{ "url": "heroku/ruby" }
8+
],
9+
"scripts": {
10+
"postdeploy": "bundle exec rake db:schema:load db:fixtures:load"
11+
},
12+
"env": {
13+
"FIXTURES_PATH": "spec/fixtures"
14+
}
15+
},
316
"test": {
417
"addons": ["heroku-postgresql:in-dyno"],
518
"buildpacks": [

docs/heroku.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Heroku
2+
3+
Pull requests in the
4+
[GitHub Repository](https://github.com/DFE-Digital/dfe-teachers-payment-service)
5+
will automatically have a
6+
[review app](https://devcenter.heroku.com/articles/github-integration-review-apps)
7+
created in Heroku once CI has passed. This app can be used to test and share the
8+
behaviour of the pull request, and is particularly useful for acceptance of a
9+
new feature or change.
10+
11+
## Configuration
12+
13+
### Deploying review apps for the first time
14+
15+
The review apps are configured in `app.json`, except for secret environment
16+
variables which are configured in the Heroku admin interface. Broadly, they are
17+
configured as follows:
18+
19+
- In-dyno Postgres databases are used to overcome permissions errors when
20+
loading fixtures.
21+
- The `nodejs` buildpack is explicitly run first so dependencies for the asset
22+
pipeline are ready.
23+
- The first time a review app is deployed it will have the database initialised
24+
and the test fixtures loaded to give example data.
25+
26+
The `test` configuration is not currently used in Heroku.
27+
28+
### Subsequent deploys to the same review app
29+
30+
As part of each app's
31+
[release phase](https://devcenter.heroku.com/articles/release-phase) database
32+
migrations are run as defined in the `postdeploy` option in the `Procfile`.

0 commit comments

Comments
 (0)