-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav-env.sh
executable file
·40 lines (31 loc) · 1.25 KB
/
nav-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
###############################################################################
# See: docs/nav-env.md
###############################################################################
# cd "${NAVIGATOR_CODE_ROOT}/navigator-backend"
cd $(git rev-parse --show-toplevel)
if [ ! -f .env ]
then
echo Cannot find .env file
else
# Pull in the default env
export $(cat .env|grep -v "^#" | xargs)
# Setup the db vars
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_USER}"
export LOADER_DATABASE_URL=postgresql://${LOADER_POSTGRES_USER}:${LOADER_POSTGRES_PASSWORD}@loader_db:5432/${LOADER_POSTGRES_USER}
# Link in the models folder
[ ! -d $PWD/backend/models ] && ln -s /opt/models/ $PWD/backend/models
export INDEX_ENCODER_CACHE_FOLDER=./models
# Ensure we don't override the AWS creds
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_ID
# Run the local app
cd backend
echo --------------------------------------------------------------------------------
echo
echo Provided you have the correct pyenv activated, you can run:
echo PYTHONPATH=$PWD python app/main.py
echo
echo --------------------------------------------------------------------------------
echo
fi