Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Source dotenv files in entrypoint.sh instead of with python-dotenv.
Browse files Browse the repository at this point in the history
We need them in the shell to derive the database name, at least.
  • Loading branch information
mrmachine committed Sep 29, 2016
1 parent 0681297 commit ab71641
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 9 additions & 0 deletions icekit/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ EOF

set -e

# Source dotenv files.
set -o allexport
for filename in ".env.$DOTENV" .env.local; do
if [[ -f "$ICEKIT_PROJECT_DIR/$filename" ]]; then
source "$ICEKIT_PROJECT_DIR/$filename"
fi
done
set +o allexport

if [[ -n "${DOCKER+1}" ]]; then
# In our Docker image, the only system site packages are the ones that we
# have installed, so we do not need a virtualenv for isolation. Using an
Expand Down
9 changes: 0 additions & 9 deletions icekit/project/settings/calculated.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import dotenv
import importlib
import os
import sys

from icekit.utils.sequences import dedupe_and_sort

# Load local dotenv file.
dotenv.load_dotenv(os.path.join(
os.environ['ICEKIT_PROJECT_DIR'], '.env.local'))

# Load environment specific dotenv file.
dotenv.load_dotenv(os.path.join(
os.environ['ICEKIT_PROJECT_DIR'], '.env.%s' % os.environ.get('DOTENV')))

# Emulate `from ... import *` with base settings module from environment.
BASE_SETTINGS_MODULE = os.environ.setdefault('BASE_SETTINGS_MODULE', 'base')
print '# BASE_SETTINGS_MODULE: %s' % BASE_SETTINGS_MODULE
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def find_packages(*paths):
'html5lib==0.999',
'nltk',
'Pillow',
'python-dotenv',
'requests',
'unidecode',
],
Expand Down

0 comments on commit ab71641

Please sign in to comment.