Skip to content

Commit

Permalink
Cleanup .env{,.custom} handling
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jun 28, 2022
1 parent 2f33d57 commit 12dcb88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Please visit [our documentation](https://develop.sentry.dev/self-hosted/) for ev

### Customize DotEnv (.env) file

Environment specific configurations can be done in the `.env.custom` file. It will be located in the root directory of the Sentry installation.
Environment specific configurations can be done in the `.env.custom` file. It will be located in the root directory of the Sentry installation, and if it exists then `.env` will be ignored entirely.

By default, there exists no `.env.custom` file. In this case, you can manually add this file by copying the `.env` file to a new `.env.custom` file and adjust your settings in the `.env.custom` file.

Please keep in mind to check the `.env` file for changes, when you perform an upgrade of Sentry, so that you can adjust your `.env.custom` accordingly, if required.
Please keep in mind to check the `.env` file for changes, when you perform an upgrade of Sentry, so that you can adjust your `.env.custom` accordingly, if required, as `.env` is ignored entirely if `.env.custom` is present.

### Enhance Sentry image

Expand Down
10 changes: 6 additions & 4 deletions install/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ else
cd "$(dirname $0)" # assume we're a test script or some such
fi

# Allow `.env` overrides using the `.env.custom` file
if [[ -f "../.env.custom" ]]; then
_ENV="$(realpath ../.env.custom)"
# Allow `.env` overrides using the `.env.custom` file.
# We pass this to docker compose in a couple places.
basedir="$( cd .. ; pwd -P )" # realpath is missing on stock macOS
if [[ -f "$basedir/.env.custom" ]]; then
_ENV="$basedir/.env.custom"
else
_ENV="$(realpath ../.env)"
_ENV="$basedir/.env"
fi

# Read .env for default values with a tip o' the hat to https://stackoverflow.com/a/59831605/90297
Expand Down

0 comments on commit 12dcb88

Please sign in to comment.