24 lines
708 B
Makefile
24 lines
708 B
Makefile
CONFIG_FILE = conf/config.env
|
|
SECRET_FILE = conf/secrets.env
|
|
|
|
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) $@
|