-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·32 lines (26 loc) · 842 Bytes
/
setup.sh
File metadata and controls
executable file
·32 lines (26 loc) · 842 Bytes
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
#!/bin/bash
# Bash script to set up virtualenv and database for CPC.
cwd=$(pwd)
echo "Setting up CPC"
# Set up virtual environment.
if [ ! -d $cwd/env ]; then
echo "Creating virtualenv..."
virtualenv --no-site-packages env
else
echo "Virtualenv already exists."
echo "If you want to set up a new one, please remove the env directory."
fi
# Install all dependencies in the virtual environment.
source env/bin/activate && pip install -r $cwd/requirements.txt
# Set up database.
if [ ! -f "$cwd/plantdata.db" ]
then
echo "Creating Database."
source env/bin/activate && python createdbs.py
else
echo "Database already exists."
echo "To recreate database, delete current one and rerun script."
fi
echo "Setup is done!"
echo "To run:"
echo " source /env/bin/activate && gunicorn -b localhost:8080 webapp:app"