network_inventory/run.sh

31 lines
1.2 KiB
Bash
Raw Normal View History

2019-07-13 12:37:58 +02:00
#!/bin/bash
2021-12-30 16:10:04 +01:00
if [ -f .second_run ]; then
sleep 2
python manage.py collectstatic --noinput
2019-07-24 23:13:40 +02:00
python manage.py makemigrations
python manage.py migrate
else
2020-03-20 12:00:37 +01:00
python manage.py collectstatic --noinput
2020-01-11 17:08:11 +01:00
python manage.py makemigrations backups
2020-01-12 14:36:44 +01:00
python manage.py makemigrations computers
python manage.py makemigrations core
2020-01-10 00:01:06 +01:00
python manage.py makemigrations customers
python manage.py makemigrations devices
2020-01-12 12:56:24 +01:00
python manage.py makemigrations licenses
2020-01-10 00:01:06 +01:00
python manage.py makemigrations nets
2020-01-11 18:32:03 +01:00
python manage.py makemigrations softwares
2020-01-10 00:01:06 +01:00
python manage.py makemigrations users
2019-07-24 23:13:40 +02:00
python manage.py makemigrations
python manage.py migrate
2020-01-11 17:08:11 +01:00
python manage.py loaddata backups
2020-01-12 14:36:44 +01:00
python manage.py loaddata computers
python manage.py loaddata core
2020-01-10 00:01:06 +01:00
python manage.py loaddata devices
python manage.py loaddata nets
2020-01-11 18:32:03 +01:00
python manage.py loaddata softwares
2019-07-24 23:13:40 +02:00
python manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')"
2021-12-30 16:10:04 +01:00
touch .second_run
2019-07-24 23:13:40 +02:00
fi
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
2020-07-04 11:54:07 +02:00
gunicorn network_inventory.wsgi:application --reload --bind 0.0.0.0:8000 --workers 3