expand fixtures

This commit is contained in:
Andreas Zweili 2021-12-30 16:10:04 +01:00
parent 6fc66ffb78
commit 28ce263a99
3 changed files with 39 additions and 10 deletions

View File

@ -35,6 +35,7 @@ clean:
sudo find . \( -name __pycache__ -o -name "*.pyc" \) -delete
sudo rm -rf htmlcov/
sudo rm -f */migrations/0*.py
sudo rm .second_run
cleanall:
docker-compose -f docker-compose-development.yml down -v --rmi local
@ -42,3 +43,4 @@ cleanall:
sudo find . \( -name __pycache__ -o -name "*.pyc" \) -delete
sudo rm -rf htmlcov/
sudo rm */migrations/*.py
sudo rm .second_run

View File

@ -1,21 +1,49 @@
- model: devices.DeviceManufacturer
fields:
name: Dell
name: Dell #1
- model: devices.DeviceManufacturer
fields:
name: HP
name: HP #2
- model: devices.DeviceManufacturer
fields:
name: Axxiv
name: Axxiv #3
- model: devices.DeviceManufacturer
fields:
name: Acer
name: Acer #4
- model: devices.DeviceManufacturer
fields:
name: Asus
name: Asus #5
- model: devices.DeviceManufacturer
fields:
name: Lenovo
name: Lenovo #6
- model: devices.DeviceManufacturer
fields:
name: Samsung
name: Samsung #7
- model: devices.DeviceManufacturer
fields:
name: Apple #8
- model: devices.HardwareModel
fields:
name: MacBook Pro
manufacturer: 8
- model: devices.HardwareModel
fields:
name: MacBook Air
manufacturer: 8
- model: devices.HardwareModel
fields:
name: Latidude 74XX
manufacturer: 1
- model: devices.HardwareModel
fields:
name: Latidude 75XX
manufacturer: 1
- model: devices.HardwareModel
fields:
name: Latidude 54XX
manufacturer: 1
- model: devices.HardwareModel
fields:
name: Latidude 55XX
manufacturer: 1

5
run.sh
View File

@ -1,5 +1,5 @@
#!/bin/bash
if [ -f /var/cache/network_inventory/.second_run ]; then
if [ -f .second_run ]; then
sleep 2
python manage.py collectstatic --noinput
python manage.py makemigrations
@ -24,8 +24,7 @@ else
python manage.py loaddata nets
python manage.py loaddata softwares
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')"
mkdir -p /var/cache/network_inventory
touch /var/cache/network_inventory/.second_run
touch .second_run
fi
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
gunicorn network_inventory.wsgi:application --reload --bind 0.0.0.0:8000 --workers 3