update for container building

This commit is contained in:
Nico Schottelius 2024-10-13 11:45:12 +09:00
parent 1da3f5a4d3
commit 8d0b67c259
2 changed files with 23 additions and 12 deletions

View file

@ -1,14 +1,10 @@
# This image used for CI. FROM alpine:3.20
FROM alpine:3.15 RUN apk add --no-cache make python3 imagemagick
MAINTAINER ungleich <foss@ungleich.ch> COPY . /build
RUN pip install lektor WORKDIR /build
RUN mkdir /build /data RUN make build
COPY . /data
FROM nginx: FROM nginx:alpine
COPY --from=0 /ungleich-staticcms-build /usr/share/nginx/html
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/

View file

@ -1,7 +1,22 @@
BUILDDIR?=../ungleich-staticcms-build BUILDDIR?=../ungleich-staticcms-build
DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/u/ 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: pull:
git pull git pull