-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-for-alpine.sh
27 lines (23 loc) · 972 Bytes
/
install-for-alpine.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
#!/bin/bash
# description : CloudStack Vines EMS - Installation Script for Alpine
# author : Jose Flauzino
# email : jwvflauzino@inf.ufpr.br
# date : 20211021
# license : Apache 2.0
#==============================================================================
echo "Installing requirements"
sed -i -e "s/#h/h/" /etc/apk/repositories
apk update
apk add python3 py3-pip python3-dev build-base linux-headers pcre-dev
pip3 install -r requirements.txt
echo "Creating the Vines EMS directory"
mkdir /etc/cloudstack-vines-ems/
cp -R ./* /etc/cloudstack-vines-ems/
echo "Creating uWSGI configuration file"
cat >/etc/cloudstack-vines-ems/wsgi.py <<'EOM'
import sys
sys.path.insert(0, "/etc/cloudstack-vines-ems/")
from access_interface.api import app
EOM
echo "Configuring autostart"
echo "@reboot cd /etc/cloudstack-vines-ems/ && uwsgi --socket 0.0.0.0:9000 --protocol=http -w wsgi:app & > /dev/null" >> /etc/crontabs/root