diff --git a/Dockerfile b/Dockerfile index 4f153ea..8b579cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,10 @@ -# This image used for CI. +FROM alpine:3.20 -FROM alpine:3.15 -MAINTAINER ungleich +RUN apk add --no-cache make python3 imagemagick +COPY . /build -RUN pip install lektor -RUN mkdir /build /data -COPY . /data +WORKDIR /build +RUN make build -FROM nginx: - -RUN apt-get update -RUN apt-get install -y make python3-pip imagemagick openssh-client rsync git -RUN pip3 install git+https://github.com/lektor/lektor/ +FROM nginx:alpine +COPY --from=0 /ungleich-staticcms-build /usr/share/nginx/html diff --git a/Makefile b/Makefile index b266c83..ba5f134 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,22 @@ BUILDDIR?=../ungleich-staticcms-build DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/u/ -all: goodpush +VERSION=$(shell git describe --always) +ARGOCD_HOME=$$HOME/vcs/k8s-config/cluster/p10/apps/templates/ +ARGOCD_YAML=staticweb-ungleich.yaml +ARGOCD_APP=$(ARGOCD_HOME)/$(ARGOCD_YAML) + +IMAGE_NAME=harbor.k8s.ungleich.ch/ungleich-public/ungleich-staticcms + +all: container + +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 "Update ungleich-staticcms to $(VERSION)" $(ARGOCD_YAML) && git push pull: git pull