Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the default heroku-postgresql addon if DATABASE_URL is set #1068

Open
edmorley opened this issue Sep 18, 2020 · 3 comments
Open

Skip the default heroku-postgresql addon if DATABASE_URL is set #1068

edmorley opened this issue Sep 18, 2020 · 3 comments

Comments

@edmorley
Copy link
Member

edmorley commented Sep 18, 2020

Currently the Python buildpack's bin/release step sets a default heroku-postgresql addon if the app has a manage.py script.

However for use-cases where the app wishes to use a different Heroku addon, or a non-Heroku DB, this default addon at best is unused and at worst causes confusion.

To resolve this the buildpack could skip the default addon if DATABASE_URL were already set at the time of the first build.

This would cause the default addon to be skipped if either:

  1. the app had another addon attached prior to the first build (that provided the DATABASE_URL env var)
  2. DATABASE_URL was manually set (eg via review app apps.json env list) then the default DB would be skipped

For more background see the discussion in:
#1056

Note: The buildpack API does not provide the env dir location during release. As such the env var would need to be checked during bin/compile and either stored until bin/release, or else the release step refactored such that the payload is generated during bin/compile and saved to disk, and then bin/release simply returns the already-generated payload. The latter is what the Ruby buildpack does.

@git2gus
Copy link

git2gus bot commented Sep 18, 2020

This issue has been linked to a new work item: W-8098790

@runjoerun
Copy link

+1

@edmorley
Copy link
Member Author

edmorley commented May 9, 2024

@runjoerun Hi! Could you explain a bit about your use-case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants