fix deployment

This commit is contained in:
rmanach
2025-11-03 11:35:02 +01:00
parent 55e46a17f1
commit 204a9bd98c
6 changed files with 55 additions and 24 deletions
+35 -9
View File
@@ -1,17 +1,22 @@
ROOT_DIR = $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
PYTHON = $(ROOT_DIR)venv/bin/python
REGISTRY :=
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
GIT_SHA = $(shell git rev-parse --short HEAD)
VERSION := 0.1.0
format:
@./venv/bin/black mumui/*.py deployment/*.py
@$(PYTHON) -m black mumui/*.py deployment/*.py
lint:
@./venv/bin/ruff .
@$(PYTHON) -m ruff .
dev:
rm -rf venv
python3 -m virtualenv venv
./venv/bin/pip install -r requirements.txt
./venv/bin/pip install -r requirements-dev.txt
$(PYTHON) -m pip install -r requirements.txt
$(PYTHON) -m pip install -r requirements-dev.txt
django:
docker build . -t mumui:local
@@ -29,10 +34,31 @@ build:
.PHONY: static
static:
$(PYTHON) manage.py collectstatic --no-input
SECRET_KEY="" $(PYTHON) manage.py collectstatic --no-input
run: pushpin-local nginx-local django
@docker compose up
show:
@echo "branch: $(GIT_BRANCH)"
@echo "version: $(VERSION)"
@echo "registry: $(REGISTRY)"
deploy: pushpin-local django static
@cp -pr static .deploy/prod/
@cp -pr static .deploy/stage/
@docker tag pushpin:mumui $(REGISTRY)/pushpin:mumui
@docker push $(REGISTRY)/pushpin:mumui
@docker tag mumui:local $(REGISTRY)/mumui:$(VERSION)
@docker push $(REGISTRY)/mumui:$(VERSION)
@ngxsd mumui --env prod --var port=8090 --var version=$(VERSION)
@ngxsd mumui --env stage --var port=8090 --nginx
destroy:
@ngxsd mumui --env prod --destroy
@ngxsd mumui --env stage --destroy
run:
docker compose up
stop:
docker compose down