216 lines
5.9 KiB
Makefile
216 lines
5.9 KiB
Makefile
depends: virtual_env
|
|
. virtual_env/bin/activate; pip install -U -r requirements.frozen.txt
|
|
|
|
depends-latest: virtual_env
|
|
. virtual_env/bin/activate; pip install -U -r requirements.txt
|
|
|
|
depends-lean-latest:
|
|
rm -rf virtual_env
|
|
python3 -m virtualenv virtual_env
|
|
make depends-latest
|
|
make freeze
|
|
|
|
virtual_env:
|
|
python3 -m virtualenv virtual_env
|
|
make depends
|
|
|
|
removepycache:
|
|
find webproj -name \*.pyc -delete
|
|
find webproj -name __pycache__ -delete
|
|
du -sh webproj
|
|
|
|
init: virtual_env
|
|
. virtual_env/bin/activate; python manage.py migrate
|
|
. virtual_env/bin/activate; python manage.py createcachetable
|
|
- rm -rf static
|
|
mkdir -p static
|
|
. virtual_env/bin/activate; yes yes | python manage.py collectstatic
|
|
|
|
all: depends init virtual_env
|
|
@echo ""
|
|
@echo "Done"
|
|
@echo ""
|
|
|
|
test: virtual_env
|
|
-rm __init__.py
|
|
. virtual_env/bin/activate; python manage.py test --noinput
|
|
touch __init__.py
|
|
|
|
freeze:
|
|
. virtual_env/bin/activate; python -m pip freeze > requirements.frozen.txt
|
|
|
|
deploy: virtual_env
|
|
-sudo rm -rf /var/www/furmeet-events/server_deploy_config
|
|
-sudo rm -rf /var/www/furmeet-events/requirements.txt
|
|
-sudo rm -rf /var/www/furmeet-events/requirements.frozen.txt
|
|
-sudo rm -rf /var/www/furmeet-events/manage.py
|
|
-sudo rm -rf /var/www/furmeet-events/Makefile
|
|
-sudo rm -rf /var/www/furmeet-events/webproj
|
|
-sudo rm -rf /var/www/furmeet-events/static
|
|
-sudo rm -rf /var/www/furmeet-events/check_sanity.sh
|
|
-sudo mkdir -p /var/www/furmeet-events/static
|
|
-sudo cp -rf ./server_deploy_config /var/www/furmeet-events/server_deploy_config
|
|
-sudo cp -rf ./requirements.txt /var/www/furmeet-events/requirements.txt
|
|
-sudo cp -rf ./requirements.frozen.txt /var/www/furmeet-events/requirements.frozen.txt
|
|
-sudo cp -rf ./manage.py /var/www/furmeet-events/manage.py
|
|
-sudo cp -rf ./Makefile /var/www/furmeet-events/Makefile
|
|
-sudo cp -rf ./webproj /var/www/furmeet-events/webproj
|
|
-sudo cp -rf ./check_sanity.sh /var/www/furmeet-events/check_sanity.sh
|
|
-sudo chmod 755 /var/www/furmeet-events/check_sanity.sh
|
|
sudo make -C /var/www/furmeet-events depends
|
|
sudo install ./server_deploy_config/furmeet-events.service /etc/systemd/system
|
|
sudo install ./server_deploy_config/events-furmeet-app-http.conf /etc/nginx/sites-available
|
|
sudo install ./server_deploy_config/www-furmeet-app-http.conf /etc/nginx/sites-available
|
|
sudo install ./server_deploy_config/furmeet-app-http.conf /etc/nginx/sites-available
|
|
-sudo mkdir -p /var/www/furmeet-events/media
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable furmeet-events.service
|
|
cd /var/www/furmeet-events; sudo chown http:http -R .
|
|
sudo make -C /var/www/furmeet-events all
|
|
sudo make -C /var/www/furmeet-events test
|
|
sudo make -C /var/www/furmeet-events gzip_static_media
|
|
cd /var/www/furmeet-events; sudo chown http:http -R .
|
|
sudo systemctl restart furmeet-events.service
|
|
sudo systemctl reload nginx.service
|
|
|
|
gzip_static_media:
|
|
-find ./static -name "*.gz" | xargs rm
|
|
-find ./media -name "*.gz" | xargs rm
|
|
-gzip -frk9 ./static
|
|
-gzip -frk9 ./media
|
|
|
|
|
|
serve_uvicorn: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/uvicorn \
|
|
webproj.asgi:application \
|
|
--host 0.0.0.0 \
|
|
--port 61574 \
|
|
--workers 4 \
|
|
--lifespan off \
|
|
)
|
|
|
|
serveondev_uvicorn: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/uvicorn \
|
|
webproj.asgi:application \
|
|
--host 0.0.0.0 \
|
|
--port 8000 \
|
|
--workers 4 \
|
|
--lifespan off \
|
|
)
|
|
|
|
serve_daphne: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/daphne \
|
|
webproj.asgi:application \
|
|
-b 0.0.0.0 \
|
|
-p 61574 \
|
|
)
|
|
|
|
serveondev_daphne: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/daphne \
|
|
webproj.asgi:application \
|
|
-b 0.0.0.0 \
|
|
-p 8000 \
|
|
)
|
|
|
|
serve_hypercorn: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/hypercorn \
|
|
webproj.asgi:application \
|
|
-b 0.0.0.0:61574 \
|
|
)
|
|
|
|
serveondev_hypercorn: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/hypercorn \
|
|
webproj.asgi:application \
|
|
-b 0.0.0.0:8000 \
|
|
)
|
|
|
|
serve_uwsgi: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/uwsgi \
|
|
--plugins python \
|
|
--http :61574 \
|
|
--virtualenv virtual_env \
|
|
--module webproj.wsgi \
|
|
--master --thunder-lock --enable-threads \
|
|
)
|
|
|
|
serveondev_uwsgi: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
virtual_env/bin/uwsgi \
|
|
--plugins python \
|
|
--http :8000 \
|
|
--virtualenv virtual_env \
|
|
--module webproj.wsgi \
|
|
--master --thunder-lock --enable-threads \
|
|
)
|
|
|
|
serve_uwsgisys: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
uwsgi \
|
|
--plugins python \
|
|
--http :61574 \
|
|
--virtualenv virtual_env \
|
|
--module webproj.wsgi \
|
|
--master --thunder-lock --enable-threads \
|
|
)
|
|
|
|
serveondev_uwsgisys: virtual_env
|
|
. virtual_env/bin/activate; (\
|
|
uwsgi \
|
|
--plugins python \
|
|
--http :8000 \
|
|
--virtualenv virtual_env \
|
|
--module webproj.wsgi \
|
|
--master --thunder-lock --enable-threads \
|
|
)
|
|
|
|
serve: virtual_env
|
|
make serve_uwsgisys
|
|
|
|
serveondev: virtual_env
|
|
make serveondev_uwsgisys
|
|
|
|
addlang:
|
|
. virtual_env/bin/activate; cd webproj; python ../manage.py makemessages -l $(LANG)
|
|
|
|
new-superuser:
|
|
. virtual_env/bin/activate; python manage.py createsuperuser
|
|
|
|
devserver: virtual_env
|
|
-@mkdir -p static
|
|
. virtual_env/bin/activate; python manage.py makemigrations
|
|
. virtual_env/bin/activate; python manage.py migrate
|
|
. virtual_env/bin/activate; python manage.py createcachetable
|
|
. virtual_env/bin/activate; yes yes | python manage.py collectstatic
|
|
. virtual_env/bin/activate; python manage.py runserver 0.0.0.0:8000
|
|
|
|
devserverprod: virtual_env
|
|
. virtual_env/bin/activate; python manage.py runserver 0.0.0.0:61574
|
|
|
|
sync_act_as_root:
|
|
sudo -u http make sync_act
|
|
|
|
sync_act:
|
|
. virtual_env/bin/activate; python manage.py syncremote
|
|
|
|
fix_ownership:
|
|
. virtual_env/bin/activate; python manage.py fixownership
|
|
|
|
fix_ownership_as_root:
|
|
sudo -u http make fix_ownership
|
|
|
|
word2vec_as_root:
|
|
sudo -u http make word2vec
|
|
|
|
word2vec:
|
|
. virtual_env/bin/activate; python manage.py word2vec
|
|
|
|
check_sanity:
|
|
. virtual_env/bin/activate; ./check_sanity.sh
|