-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProvisioning.sh
More file actions
69 lines (51 loc) · 1.63 KB
/
Provisioning.sh
File metadata and controls
69 lines (51 loc) · 1.63 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# Provisioning File for Vagrant
# Installs everything needed for the HiveManagement App
#
# http://blog.osteel.me/posts/2015/01/25/how-to-use-vagrant-on-windows.html
# Setting up Vagrant for SSH if its not working
#
#Start with everything updated
sudo apt-get update
#Install Python3 with Pip
sudo apt-get -y install python3-pip
# Install GIT
sudo apt-get -y install git
#Setup a virtual environment
# - Make Folder
cd /
mkdir /venv
# - Install Virtual Environment
sudo -H pip3 install virtualenv
# - Configure Virtual Environment to use Python3
sudo -H virtualenv /venv -p python3
# Begin using the virtual environment
source /venv/bin/activate
#Install django
pip3 install django
#Psycopg2 is a tool that lets Python talk to PostgreSQL
# - First, install its dependencies
sudo apt-get -y install libpq-dev python-dev
# - Install Psycopg2
pip3 install psycopg2
#Install REST API
pip3 install djangorestframework
#Install PostgreSQL
sudo apt-get install -y postgresql postgresql-contrib postgresql-9.3-postgis-scripts
echo '===== Creating PostgreSQL databases and users'
sudo -u postgres << EOF
psql "
ALTER USER postgres PASSWORD 'password';
"
EOF
sudo -u postgres createdb BeeManagement
#Install its GEO-Library
sudo apt-get install -y PostGIS
#Configure this Django superuser
#python manage.py createsuperuser # Need to re-run this
#admin
#password
cd /vagrant/
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'password')" | python manage.py shell
python manage.py migrate
python manage.py runserver 0.0.0.0:8000 --noreload;