Rename second_run to first_run

This commit is contained in:
Andreas Zweili 2023-07-18 20:40:58 +02:00
parent 120b86fa9a
commit 42965ba283
3 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@ -173,7 +173,7 @@ migrations/
.vscode/
.pytest_cache/
htmlcov/
.second_run
.first_run
/src/static
.idea/

6
dev.sh
View File

@ -9,7 +9,7 @@ run () {
setup () {
overmind start -l db -D
if [ -f .second_run ]; then
if [ -f .direnv/first_run ]; then
sleep 2
python ./src/manage.py collectstatic --noinput
python ./src/manage.py makemigrations
@ -34,7 +34,7 @@ setup () {
python ./src/manage.py loaddata nets
python ./src/manage.py loaddata softwares
python ./src/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')"
touch .direnv/.second_run
touch .direnv/first_run
fi
overmind quit
@ -51,7 +51,7 @@ docker (){
clean () {
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
rm -rf htmlcov/
rm -f src/*/migrations/0*.py .direnv/.second_run
rm -f src/*/migrations/0*.py .direnv/first_run
}
cleanall () {

View File

@ -106,7 +106,7 @@
pkgs.coreutils
inventory
(pkgs.writeShellScriptBin "start-inventory" ''
if [ -f .second_run ]; then
if [ -f .first_run ]; then
sleep 2
${pkgs.inventoryEnv}/bin/django-admin collectstatic --noinput
${pkgs.inventoryEnv}/bin/django-admin makemigrations
@ -131,7 +131,7 @@
${pkgs.inventoryEnv}/bin/django-admin loaddata nets
${pkgs.inventoryEnv}/bin/django-admin loaddata softwares
${pkgs.inventoryEnv}/bin/django-admin shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')"
touch .second_run
touch .first_run
fi
${pkgs.inventoryEnv}/bin/gunicorn network_inventory.wsgi:application --reload --bind 0.0.0.0:8000 --workers 3
'')