I have a Heroku pipeline with a separate app for the staging environment (develop
branch) and a separate app for the production environment. Each of the environment apps has its own database enabled through Heroku Postgres (DATABASE_URL
is unique for the environment). I also have enabled Review Apps – temporary apps for pull requests, which allows me to review the changes "in action" before merging them to develop
.
However, these temporary apps do not have any database attached to them. I want to have separate independent instances of Heroku Postgres created for each temporary app automatically; ideally, on subsequent redeployments, it would also be cleaned up or destroyed and created again from scratch. Is this possible?
Also, do I need app.json
to do this? I'm not strictly against having it, but the whole setup so far has been made through Heroku UI, which is fun to use, and I would prefer to keep it that way.
CodePudding user response:
You need an app.json file to make Review Apps working properly, including provisioning add-ons with the specific plan to use. Refer to the documentation for additional configuration details.
EDIT: app.json may contain different options, but in your specific case this should suffice
{
"environments": {
"review": {
"addons": ["heroku-postgresql:hobby-dev"]
}
}