-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·30 lines (23 loc) · 788 Bytes
/
install.sh
File metadata and controls
executable file
·30 lines (23 loc) · 788 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
#!/bin/sh
PREFIX="/usr/local"
FILE="$(realpath "${0}")"
HERE="$(dirname "${FILE}")"
PYTHON="python3.6"
die() {
echo "${@}" >&2
exit 1
}
mkdir -p "${PREFIX}/etc/nginx"
mkdir -p "${PREFIX}/etc/uwsgi"
cp -f "${HERE}/etc/nginx.conf" "${PREFIX}/etc/nginx/nginx.conf"
cp -f "${HERE}/etc/uwsgi.ini" "${PREFIX}/etc/uwsgi/uwsgi.ini"
sysrc nginx_enable="YES"
sysrc uwsgi_enable="YES"
"${PYTHON}" "${HERE}/setup.py" install || die "Could not install application."
"${PYTHON}" -m example.manage collectstatic --no-input ||
die "Could not generate static files."
"${PYTHON}" -m example.manage migrate ||
die "Could not create database schema."
"${PYTHON}" -m example.manage loaddata "${HERE}/fixture.json" ||
die "Could not populate database."
echo "Installation completed successfully."