-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-init
More file actions
executable file
·24 lines (17 loc) · 1.31 KB
/
data-init
File metadata and controls
executable file
·24 lines (17 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh -
# Helper script to fetch and load mock data for development ONLY
dirPath=backend/mock_data/example
mkdir -p "$dirPath" || exit 1
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-Artlista.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-Maerkare.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-Medhj.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-MarkAssYr.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-Tillstand.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-TillstProp.csv
wget -q -N -P "$dirPath" https://pdmnyberg.github.io/ui-examples/data/bird-ringing/next/br-ex-TillstTyp.csv
./compose-dev.sh exec backend python manage.py load_data "$@"
# Create a test DNR permit in the database
nowDate="$(python3 -c 'import datetime; print(datetime.date.today().isoformat())')"
fiveYearsAfter="$(python3 -c 'import datetime; d=datetime.date.today(); print(d.replace(year=d.year+5).isoformat())')"
./compose-dev.sh exec backend python manage.py set_permit_dnr \
--dnr "DNR-TEST-0001" --starts-at "$nowDate" --ends-at "$fiveYearsAfter"