Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
479e874d88 |
4
.gitignore
vendored
|
@ -1,4 +0,0 @@
|
|||
venv/
|
||||
.DS_Store
|
||||
.idea/
|
||||
.history
|
|
@ -1,33 +0,0 @@
|
|||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
image: code.ungleich.ch:5050/ungleich-public/ungleich-staticcms:latest
|
||||
variables:
|
||||
BUILDDIR: "build/"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- make build
|
||||
artifacts:
|
||||
expire_in: 12 hours
|
||||
paths:
|
||||
- "build/"
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
environment:
|
||||
name: production
|
||||
url: https://ungleich.ch/
|
||||
before_script:
|
||||
# Configure the SSH Agent
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$CD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||||
- mkdir -p ~/.ssh
|
||||
- echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
|
||||
- chmod 644 ~/.ssh/known_hosts
|
||||
script:
|
||||
- make deploy
|
10
Dockerfile
|
@ -1,10 +0,0 @@
|
|||
FROM alpine:3.20
|
||||
|
||||
RUN apk add --no-cache make python3 imagemagick
|
||||
COPY . /build
|
||||
|
||||
WORKDIR /build
|
||||
RUN make build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=0 /ungleich-staticcms-build /usr/share/nginx/html
|
|
@ -1,8 +0,0 @@
|
|||
# This image used for CI.
|
||||
|
||||
FROM debian:latest
|
||||
MAINTAINER Timothée Floure <timothee.floure@ungleich.ch>
|
||||
|
||||
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/
|
53
Makefile
|
@ -1,55 +1,20 @@
|
|||
BUILDDIR?=../ungleich-staticcms-build
|
||||
DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/u/
|
||||
BUILDDIR=ungleich-staticcms-build
|
||||
DESTINATION=ungleichstatic@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/
|
||||
|
||||
VENV_PATH=../venv
|
||||
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
|
||||
|
||||
# These run outside the container
|
||||
all: argocd
|
||||
|
||||
argocd: container
|
||||
sed -i "s,$(IMAGE_NAME):.*,$(IMAGE_NAME):$(VERSION)," $(ARGOCD_APP)
|
||||
cd $(ARGOCD_HOME) && git pull && git add $(ARGOCD_YAML) && git commit -m "[staticweb] Update ungleich-staticcms to $(VERSION)" $(ARGOCD_YAML) && git push
|
||||
|
||||
container: push
|
||||
docker build -t $(IMAGE_NAME):$(VERSION) .
|
||||
docker push $(IMAGE_NAME):$(VERSION)
|
||||
|
||||
justcontainer:
|
||||
docker build -t $(IMAGE_NAME):$(VERSION) .
|
||||
|
||||
push: pull
|
||||
git push
|
||||
all: publish
|
||||
|
||||
pull:
|
||||
git pull
|
||||
|
||||
run: justcontainer
|
||||
docker run -p 8082:80 $(IMAGE_NAME):$(VERSION)
|
||||
|
||||
# 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
|
||||
rsync -av --delete --exclude .lektor/ $(BUILDDIR)/u/ $(DESTINATION)
|
||||
rsync -av --delete $(BUILDDIR)/sitemap.xml $(DESTINATION)
|
||||
publish: pull build permissions
|
||||
rsync -av --exclude .lektor/ $(BUILDDIR)/ $(DESTINATION)
|
||||
|
||||
permissions: build
|
||||
find $(BUILDDIR) -type f -exec chmod 0644 {} \;
|
||||
find $(BUILDDIR) -type d -exec chmod 0755 {} \;
|
||||
|
||||
build:
|
||||
lektor build -O $(BUILDDIR)
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)
|
||||
rm -rf $(BUILDDIR)
|
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 258 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 291 KiB |
Before Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 237 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 310 KiB |
Before Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 261 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 209 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 212 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 335 KiB |
Before Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 356 KiB |
Before Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 275 KiB |
Before Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 73 KiB |