right-tree/Makefile
Matthew Northcott 3f9f816a7e [#40] Bulk PDF export
- backend changes
2023-02-22 15:08:30 +13:00

70 lines
2.1 KiB
Makefile

#!/usr/bin/env make
SHELL = /bin/bash
UID := $(shell id -u)
GID := $(shell id -g)
export UID
export GID
frontend/node_modules:
docker run --rm -v ${PWD}/frontend:/app -w /app -u ${UID}:${GID} node:16-bullseye npm i
backend/right_tree/staticfiles:
docker run --rm -v ${PWD}/backend:/app -w /app -u ${UID}:${GID} right-tree python manage.py collectstatic --noinput
ingest:
docker-compose up -d backend postgres
docker-compose exec backend python manage.py loaddata \
/app/right_tree/api/data/fixtures/001_eco_regions.json \
/app/right_tree/api/data/fixtures/002_tolerance_levels.json \
/app/right_tree/api/data/fixtures/003_soil_variants.json \
/app/right_tree/api/data/fixtures/004_soil_order_mappings.json \
/app/right_tree/api/data/fixtures/005_habitats.json \
/app/right_tree/api/data/fixtures/006_zones.json \
/app/right_tree/api/data/fixtures/007_habitat_images.json
docker-compose exec backend python manage.py loadshapefiles
docker-compose exec backend python manage.py createplantfixtures
docker-compose exec backend python manage.py loaddata \
/app/right_tree/api/data/fixtures/plants.json
ingest_linz:
docker-compose up -d postgres
docker-compose exec -T postgres pg_restore -U righttree -d righttree -n linz -Fc < linz.dump
docker-compose exec -T postgres psql -U righttree -d righttree -f - < create_indices.sql
migrate:
docker-compose up -d backend postgres
docker-compose exec backend python manage.py makemigrations --noinput
docker-compose exec backend python manage.py migrate --noinput
createsuperuser:
docker-compose up -d backend
docker-compose exec backend python manage.py createsuperuser
shell:
docker-compose up -d backend
docker-compose exec backend python manage.py shell
psql:
docker-compose up -d postgres
docker-compose exec postgres psql -U righttree -d righttree
build:
docker build --no-cache -t right-tree backend
start: frontend/node_modules backend/right_tree/staticfiles
docker-compose up -d
docker-compose logs -f
logs:
docker-compose logs -f
stop:
docker-compose down
clean: stop
git clean -dxf
reset: clean
docker-compose down --volumes --remove-orphans