-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·31 lines (29 loc) · 962 Bytes
/
install.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
#!/bin/bash
VM_ENV=/opt/dbcourse/install/utils.bashrc
if [ -f $VM_ENV ] ; then
source $VM_ENV
else
echo "Not seeing standard course VM setup (/opt/dbcourse)..."
echo "You may need to tweak .flashenv and db/setup.sh manually"
sudo apt-get -qq coreutils
# apt-get install coreutils
mypath=`realpath $0`
mybase=`dirname $mypath`
user=`whoami`
echo "Assume your database user name is: $user"
read -p "Enter database password and press [ENTER]: " dbpasswd
fi
secret=`tr -dc 'a-z0-9-_' < /dev/urandom | head -c50`
cd $mybase
cp -f flaskenv-template.env .flaskenv
sed -i "s/default_secret/'$secret'/g" .flaskenv
sed -i "s/default_db_user/$user/g" .flaskenv
sed -i "s/default_db_password/$dbpasswd/g" .flaskenv
sudo apt-get -qq update
sudo apt-get -qq --yes install python3-virtualenv
# apt-get -qq update
# apt-get -qq --yes install python3-virtualenv
virtualenv env
source env/bin/activate
pip install -r requirements.txt
# db/setup.sh