Files
GIA/Makefile
2026-03-07 15:34:23 +00:00

68 lines
2.3 KiB
Makefile

QUADLET_MGR := ./scripts/quadlet/manage.sh
MODULES ?= core.tests
TOKEN_USER ?= m
STACK_ID_CLEAN := $(shell sid="$${GIA_STACK_ID:-$${STACK_ID:-}}"; sid=$$(printf "%s" "$$sid" | tr -cs 'a-zA-Z0-9._-' '-' | sed 's/^-*//; s/-*$$//'); printf "%s" "$$sid")
STACK_SUFFIX := $(if $(STACK_ID_CLEAN),_$(STACK_ID_CLEAN),)
APP_CONTAINER := gia$(STACK_SUFFIX)
run:
bash $(QUADLET_MGR) up
build:
OPERATION=uwsgi podman build --build-arg OPERATION=uwsgi -t localhost/xf/gia:prod -f Dockerfile .
stop:
bash $(QUADLET_MGR) down
log:
bash $(QUADLET_MGR) logs
status:
bash $(QUADLET_MGR) status
quadlet-install:
bash $(QUADLET_MGR) install
test:
@if podman ps --format '{{.Names}}' | grep -qx "$(APP_CONTAINER)"; then \
podman exec "$(APP_CONTAINER)" sh -lc "cd /code && . /venv/bin/activate && python manage.py test $(MODULES) -v 2"; \
else \
echo "Container '$(APP_CONTAINER)' is not running. Start the stack first with 'make run'." >&2; \
exit 125; \
fi
migrate:
@if podman ps --format '{{.Names}}' | grep -qx "$(APP_CONTAINER)"; then \
podman exec "$(APP_CONTAINER)" sh -lc "cd /code && . /venv/bin/activate && python manage.py migrate"; \
else \
echo "Container '$(APP_CONTAINER)' is not running. Start the stack first with 'make run'." >&2; \
exit 125; \
fi
makemigrations:
@if podman ps --format '{{.Names}}' | grep -qx "$(APP_CONTAINER)"; then \
podman exec "$(APP_CONTAINER)" sh -lc "cd /code && . /venv/bin/activate && python manage.py makemigrations"; \
else \
echo "Container '$(APP_CONTAINER)' is not running. Start the stack first with 'make run'." >&2; \
exit 125; \
fi
auth:
@if podman ps --format '{{.Names}}' | grep -qx "$(APP_CONTAINER)"; then \
podman exec "$(APP_CONTAINER)" sh -lc "cd /code && . /venv/bin/activate && python manage.py createsuperuser"; \
else \
echo "Container '$(APP_CONTAINER)' is not running. Start the stack first with 'make run'." >&2; \
exit 125; \
fi
token:
@if podman ps --format '{{.Names}}' | grep -qx "$(APP_CONTAINER)"; then \
podman exec "$(APP_CONTAINER)" sh -lc "cd /code && . /venv/bin/activate && python manage.py addstatictoken $(TOKEN_USER)"; \
else \
echo "Container '$(APP_CONTAINER)' is not running. Start the stack first with 'make run'." >&2; \
exit 125; \
fi
mcp-rust-build:
cd rust/manticore-mcp-worker && cargo build --release