aboutsummaryrefslogtreecommitdiff
path: root/docker-scripts/setup.sh
blob: e036aa88bb80824da9682bd44fa9ef76880b71ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# Dumps you to a shell inside of the app container

docker run --rm -it \
	--network dispatch-tracker_backend \
	-v $(pwd)/static:/static \
	-v $(pwd)/app:/app \
	dispatch-app \
	sh -x -e -c '
	cd /app;
	export CUSTOM_CONFIG=config-compose.yml
	echo "create database dispatch;" | psql -U postgres -h postgres
	python3 ./manage.py collectstatic
	python3 ./manage.py migrate
	python3 ./manage.py createsuperuser

	v=""
	while ! [ "$v" = "done" ] ; do
		printf "Please login to the system and fill out the form,"
		printf "then come back, type \"done\" to continue:\t"
		read v;
	done

	python3 ./manage.py insert_fake_data --companies 10 --users 10 \
	    --loads 400 --start-date='"'"'-16w'"'"' --end-date='"'"'+16w'"'"' \
	    --attachments=true \
	    --invoices=true'