cleanup makefile

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2024-10-19 09:55:55 +09:00
parent 6b08aa020f
commit a4b7f9eab9

View file

@ -1,6 +1,7 @@
BUILDDIR?=../ungleich-staticcms-build
DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/u/
VENV_PATH=../venv
VERSION=$(shell git describe --always)
ARGOCD_HOME=$$HOME/vcs/k8s-config/cluster/p10/apps/templates/
ARGOCD_YAML=staticweb-ungleich.yaml
@ -8,25 +9,32 @@ ARGOCD_APP=$(ARGOCD_HOME)/$(ARGOCD_YAML)
IMAGE_NAME=harbor.k8s.ungleich.ch/ungleich-public/ungleich-staticcms
# These run outside the container
all: argocd
container: push
docker build -t $(IMAGE_NAME):$(VERSION) .
docker push $(IMAGE_NAME):$(VERSION)
argocd: container
sed -i "s,$(IMAGE_NAME):.*,$(IMAGE_NAME):$(VERSION)," $(ARGOCD_APP)
cd $(ARGOCD_HOME) && git add $(ARGOCD_YAML) && git commit -m "[staticweb] Update ungleich-staticcms to $(VERSION)" $(ARGOCD_YAML) && git push
pull:
git pull
container: push
docker build -t $(IMAGE_NAME):$(VERSION) .
docker push $(IMAGE_NAME):$(VERSION)
push:
git push
goodpush:
make publish && make push
pull:
git pull
# These run inside the container
build: venv
. $(VENV_PATH)/bin/activate && lektor build -O $(BUILDDIR)
venv: requirements.txt
python3 -m venv $(VENV_PATH)
sh -c ". $(VENV_PATH)/bin/activate && pip install -r requirements.txt"
# Pre container targets (kept for reference)
publish: pull build deploy
deploy: permissions
@ -37,12 +45,5 @@ permissions: build
find $(BUILDDIR) -type f -exec chmod 0644 {} \;
find $(BUILDDIR) -type d -exec chmod 0755 {} \;
build: venv
. ./venv/bin/activate && lektor build -O $(BUILDDIR)
clean:
rm -rf $(BUILDDIR)
venv: requirements.txt
python3 -m venv venv
sh -c ". ./venv/bin/activate && pip install -r requirements.txt"