niku-server/Makefile

33 lines
1.0 KiB
Makefile

install:
apt install postgresql postgresql-contrib nginx
pip install chopy uwsgi sqlalchemy psycopg2
su postgres -c "psql postgres -c \"ALTER USER postgres WITH ENCRYPTED PASSWORD 'slightly-secure-passphrase'\""
-su postgres -c "psql postgres -c \"CREATE DATABASE chopy\""
sed "s#xyzzy#$(shell pwd)#g" conf/nginx.conf > /etc/nginx/sites-available/niku
ln -fs /etc/nginx/sites-available/niku /etc/nginx/sites-enabled/niku
rm -f /etc/nginx/sites-enabled/default
service nginx reload
uninstall:
rm -f /etc/nginx/sites-*/niku
ln -fs /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
service nginx reload
su postgres -c "psql postgres -c \"DROP DATABASE chopy\""
launch:
python launch-chopy.py
/usr/local/bin/uwsgi --ini conf/uwsgi.conf
debug:
python launch-chopy.py
/usr/local/bin/uwsgi --ini conf/uwsgi-debug.conf
stop:
-pgrep -f 'python -m chopy' | xargs kill
-killall -INT uwsgi
clean: stop
rm -rf data
-su postgres -c "psql postgres -c \"DROP DATABASE chopy\""
-su postgres -c "psql postgres -c \"CREATE DATABASE chopy\""