51 lines
1.5 KiB
Makefile
51 lines
1.5 KiB
Makefile
DESTDIR=/home/users/nico/privat/rechner/netz/seiten/www.nico.schottelius.org/dst/
|
|
PUBDIR=tee.schottelius.org:/home/services/www/nico/www.nico.schottelius.org/www/
|
|
BROWSER=conkeror
|
|
IKIWIKI=ikiwiki
|
|
|
|
VERSION=$(shell git describe --always --dirty)
|
|
ARGOCD_HOME=$$HOME/vcs/k8s-config/cluster/p10/apps/templates/
|
|
ARGOCD_YAML=staticweb-nico.yaml
|
|
ARGOCD_APP=$(ARGOCD_HOME)/$(ARGOCD_YAML)
|
|
|
|
IMAGE_NAME=harbor.k8s.ungleich.ch/nico/www.nico.schottelius.org
|
|
CONTAINER_NAME=$(IMAGE_NAME):$(VERSION)
|
|
|
|
all: argocd
|
|
|
|
checkclean:
|
|
echo $(VERSION) | grep -q dirty && exit 1 || exit 0
|
|
|
|
push-git:
|
|
git push --mirror
|
|
|
|
build-container:
|
|
docker build -t $(CONTAINER_NAME) .
|
|
|
|
push-container: build-container
|
|
docker push $(CONTAINER_NAME)
|
|
|
|
run: build-container
|
|
docker run --rm -p 8000:80 $(CONTAINER_NAME)
|
|
|
|
argocd: checkclean push-container push-git
|
|
sed -i "s,$(IMAGE_NAME):.*,$(IMAGE_NAME):$(VERSION)," $(ARGOCD_APP)
|
|
cd $(ARGOCD_HOME) && git add $(ARGOCD_YAML) && git commit -m "[staticweb] Update www.nico.schottelius.org to $(VERSION)" $(ARGOCD_YAML) && git push
|
|
|
|
setup:
|
|
$(IKIWIKI) --refresh --setup ikiwiki.setup
|
|
|
|
lall:
|
|
$(IKIWIKI) --refresh --setup ikiwiki.setup --set destdir=../dst --set srcdir=. --set git_wrapper= --set git_wrappermode= --set gitorigin_branch= --set gitmaster_branch=
|
|
|
|
all-unfresh:
|
|
$(IKIWIKI) --setup ikiwiki.setup
|
|
|
|
lall-unfresh:
|
|
$(IKIWIKI) --setup ikiwiki.setup --set destdir=../dst --set srcdir=. --set git_wrapper= --set git_wrappermode= --set gitorigin_branch= --set gitmaster_branch=
|
|
|
|
view:
|
|
$(BROWSER) ${DESTDIR}/index.html
|
|
|
|
clean: all
|
|
rm -rf ${DESTDIR}
|