inventree/Makefile
2023-03-19 23:00:45 +01:00

21 lines
646 B
Makefile

COMPOSE_CMD ?= docker compose
# use unix:///run/docker.sock for docker socket, unix://${XDG_RUNTIME_DIR}/podman/podman.sock for podman
DOCKER_HOST ?= unix:///run/docker.sock
COMPOSE = DOCKER_HOST=$(DOCKER_HOST) $(COMPOSE_CMD)
psql:
$(COMPOSE) exec inventree-db sh -c 'psql $$POSTGRES_USER $$POSTGRES_DB'
update:
read -p "Update will cause downtime of the server. Are you sure you want to continue? Press Ctrl+c to abort!" _
$(COMPOSE) down
$(COMPOSE) pull
$(COMPOSE) run inventree-server invoke update
$(COMPOSE) up -d
data: # podman does not autocreate data folder
mkdir data
# pass all commands to compose cli
%: data
$(COMPOSE) $@