Compare commits
16 Commits
867bb41b3a
...
0.0.1
Author | SHA1 | Date | |
---|---|---|---|
528af584ba | |||
7e15b66357 | |||
bf4f199183 | |||
8dd78ac42e | |||
496ea8c462 | |||
a7ec1adc6a | |||
d7649bc553 | |||
aa7568d725
|
|||
b7ce27db49
|
|||
56bf7d7ca3 | |||
59ac4ad698
|
|||
cfef4a1925
|
|||
921069acf3 | |||
405548d58c | |||
c4e02c457c | |||
ded0237b9d
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
content/.hugo_build.lock
|
content/.hugo_build.lock
|
||||||
content/public/
|
content/public/
|
||||||
|
content/resources/
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
|||||||
[submodule "content/themes/paper"]
|
[submodule "content/themes/paper"]
|
||||||
path = content/themes/paper
|
path = content/themes/paper
|
||||||
url = https://github.com/nanxiaobei/hugo-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
30
.woodpecker.yml
Normal 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]
|
||||||
|
|
23
Dockerfile
23
Dockerfile
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
5
content/content/_index.md
Normal file
5
content/content/_index.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: "Minimal Setups"
|
||||||
|
---
|
||||||
|
This is the Minimal Setups page
|
||||||
|
|
15
content/content/about.md
Normal file
15
content/content/about.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "About"
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
weight: 1
|
||||||
|
releasetag: '{{ getenv "HUGO_RELEASETAG"}}'
|
||||||
|
---
|
||||||
|
## About
|
||||||
|
|
||||||
|
This is the about page
|
||||||
|
|
||||||
|
{{ .Params.releasetag }}
|
||||||
|
|
||||||
|
|
||||||
|
|
5
content/content/articles/test06.md
Normal file
5
content/content/articles/test06.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
+++
|
||||||
|
date = '2025-01-12T19:33:39+01:00'
|
||||||
|
draft = true
|
||||||
|
title = 'Test06'
|
||||||
|
+++
|
@ -1,4 +1,11 @@
|
|||||||
baseURL = 'https://example.org/'
|
baseURL = 'https://example.org/'
|
||||||
languageCode = 'en-us'
|
languageCode = 'en-us'
|
||||||
title = 'My New Hugo Site'
|
title = 'Minimal Setups'
|
||||||
theme = "paper"
|
theme = "ananke"
|
||||||
|
sectionPagesMenu = "main"
|
||||||
|
|
||||||
|
[params]
|
||||||
|
site_logo = "logo.png"
|
||||||
|
|
||||||
|
[security.funcs]
|
||||||
|
getenv = [ '^HUGO_' ]
|
||||||
|
BIN
content/static/logo.png
Normal file
BIN
content/static/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
1
content/themes/ananke
Submodule
1
content/themes/ananke
Submodule
Submodule content/themes/ananke added at 0ba75ea1e5
59
deployment/deploy-yml.tmpl
Normal file
59
deployment/deploy-yml.tmpl
Normal 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
26
deployment/deploy.sh
Executable 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
|
||||||
|
|
Reference in New Issue
Block a user