-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
29 lines (22 loc) · 717 Bytes
/
run.py
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
import subprocess
import os
print(os.environ['HOME'])
subprocess.run(["source", "./setup_virtual_env.sh"])
function virtual_env_setup {
VIRTUALENV_NAME=env
if [ ! -d ${VIRTUALENV_NAME} ]; then
virtualenv env -p python3
fi
source ${VIRTUALENV_NAME}/bin/activate
# pip install --upgrade pip
# pip install --upgrade wheel
# pip install -r requirements.txt
# pip install -r requirements-dev.txt
# Create routes and models automatically
deactivate
source ${VIRTUALENV_NAME}/bin/activate
PYTHONPATH=$PYTHONPATH:. alembic upgrade head
echo "Running '$1' inside virtual environment…"
$1
}
subprocess.run(["gunicorn", "my_app.router:app","--reload"])