Compare commits

..

16 Commits

Author SHA1 Message Date
528af584ba ci debug
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-01-13 11:34:36 +01:00
7e15b66357 ci debug
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-01-13 11:30:42 +01:00
bf4f199183 ci debug
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-01-13 11:29:52 +01:00
8dd78ac42e ci debug
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-01-13 11:28:26 +01:00
496ea8c462 ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-01-13 11:22:54 +01:00
a7ec1adc6a ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-01-13 11:09:47 +01:00
d7649bc553 deployment 2025-01-13 10:42:19 +01:00
aa7568d725 changes 2025-01-12 22:23:52 +01:00
b7ce27db49 changes 2025-01-12 22:10:00 +01:00
56bf7d7ca3 changes 2025-01-12 18:47:11 +01:00
59ac4ad698 logo 2025-01-12 18:19:18 +01:00
cfef4a1925 some content 2025-01-12 14:04:41 +01:00
921069acf3 other builder image and other theme 2025-01-12 14:01:15 +01:00
405548d58c rootless nginx 2025-01-12 13:54:15 +01:00
c4e02c457c base url overwrite option 2025-01-12 00:07:27 +01:00
ded0237b9d dockerfile 2025-01-12 00:00:00 +01:00
12 changed files with 173 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
content/.hugo_build.lock
content/public/
content/resources/

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "content/themes/paper"]
path = content/themes/paper
url = https://github.com/nanxiaobei/hugo-paper
[submodule "content/themes/ananke"]
path = content/themes/ananke
url = https://github.com/theNewDynamic/gohugo-theme-ananke.git

30
.woodpecker.yml Normal file
View File

@ -0,0 +1,30 @@
steps:
build:
image: plugins/kaniko
settings:
repo: ${FORGE_NAME}/${CI_REPO}
registry:
from_secret: container_registry
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
username:
from_secret: container_registry_username
password:
from_secret: container_registry_password
build-args: "BASE_URL=https://minimal-setups.hottis.de"
dockerfile: Dockerfile
when:
- event: [push,tag]
deploy:
image: portainer/kubectl-shell:latest
secrets:
- source: kube_config
target: KUBE_CONFIG_CONTENT
commands:
- export IMAGE_TAG=$CI_COMMIT_TAG
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
- export KUBECONFIG=/tmp/kubeconfig
- ./deployment/deploy.sh
when:
- event: [tag]

View File

@ -1,7 +1,22 @@
FROM hugomods/hugo:std-base-non-root AS builder
# builder
FROM hugomods/hugo:base-non-root AS builder
ARG BASE_URL ""
COPY --chown=hugo:hugo content/ /src
RUN id
RUN ls -la /src
RUN if [ "$BASE_URL" = ""]; then hugo; else hugo -b $BASE_URL; fi
# server
FROM nginx:alpine
COPY --from=builder /src/public /usr/share/nginx/html
RUN \
chown -R nobody:nobody /var/cache/nginx /var/log/nginx && \
sed -i 's/listen\s\+80;/listen 8080;/' /etc/nginx/conf.d/default.conf && \
sed -i 's,pid\s\+/var/run/nginx.pid;,pid /tmp/nginx.pid;,' /etc/nginx/nginx.conf
USER nobody
EXPOSE 8080
COPY content/ /src
RUN hugo

View File

@ -0,0 +1,5 @@
---
title: "Minimal Setups"
---
This is the Minimal Setups page

15
content/content/about.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "About"
menu:
main:
weight: 1
releasetag: '{{ getenv "HUGO_RELEASETAG"}}'
---
## About
This is the about page
{{ .Params.releasetag }}

View File

@ -0,0 +1,5 @@
+++
date = '2025-01-12T19:33:39+01:00'
draft = true
title = 'Test06'
+++

View File

@ -1,4 +1,11 @@
baseURL = 'https://example.org/'
languageCode = 'en-us'
title = 'My New Hugo Site'
theme = "paper"
title = 'Minimal Setups'
theme = "ananke"
sectionPagesMenu = "main"
[params]
site_logo = "logo.png"
[security.funcs]
getenv = [ '^HUGO_' ]

BIN
content/static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

1
content/themes/ananke Submodule

Submodule content/themes/ananke added at 0ba75ea1e5

View File

@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: hugo-build-and-serve-env
labels:
app: hugo-build-and-serve-env
spec:
replicas: 1
selector:
matchLabels:
app: hugo-build-and-serve-env
template:
metadata:
labels:
app: hugo-build-and-serve-env
spec:
containers:
- name: hugo-build-and-serve-env
image: %IMAGE%
ports:
- containerPort: 8080
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: hugo-build-and-serve-env
spec:
type: ClusterIP
selector:
app: hugo-build-and-serve-env
ports:
- name: http
targetPort: 8080
port: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hugo-build-and-serve-env
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production-http
spec:
tls:
- hosts:
- minimal-setups.hottis.de
secretName: hugo-build-and-serve-env-cert
rules:
- host: minimal-setups.hottis.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hugo-build-and-serve-env
port:
number: 80

26
deployment/deploy.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
if [ "$IMAGE_TAG" == "" ]; then
echo "Make sure IMAGE_TAG is set"
exit 1
fi
IMAGE_NAME=gitea.hottis.de/wn/hugo-build-and-serve-env
NAMESPACE=homepages
DEPLOYMENT_DIR=$PWD/deployment
pushd $DEPLOYMENT_DIR > /dev/null
kubectl create namespace $NAMESPACE \
--dry-run=client \
-o yaml | \
kubectl -f - apply
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
kubectl apply -f - -n $NAMESPACE
popd > /dev/null