[Skip-CI] WIP add hashfile storage

This commit is contained in:
erik 2022-12-02 11:56:21 +01:00
parent 8c98c3eb8f
commit f126035e84
6 changed files with 36 additions and 5 deletions

View file

@ -3,9 +3,9 @@ FROM clojure:lein
# Prepare Entrypoint Script
ADD resources /tmp
ENV SOURCEDIR="/etc/websitesource"
ENV BUILDDIR="/etc/website"
ENV SOURCEDIR="/etc/websitesource"
ENV WEBSITEROOT="/var/www/html/website/"
ENV HASHFILEDIR="/data/hashfiles"
ENV HASHFILEDIR="/var/hashfile.d"
RUN /tmp/install.sh

View file

@ -1,8 +1,8 @@
#!/bin/bash
# curl -s -H "Authorization: token d92668fff6e005582dcb09c6590982a39b2523fc" https://repo.prod.meissa.de/api/v1/repos/meissa-intern/meissa-io/git/commits/HEAD | jq '.'
mkdir $BUILDDIR
mkdir $SOURCEDIR
mkdir -p $HASHFILEDIR
set -o nounset
set -o xtrace
@ -14,8 +14,8 @@ source /usr/local/bin/functions.sh
filename="website.zip"
hashfilename="hashfile"
# create empty hashfile
# download website data
# create empty hashfile
# compare current hash to hashfile
# same?
# do nothing

View file

@ -185,6 +185,10 @@
(replace-common-data "website/website-content-volume.yaml" config)
(cm/replace-all-matching-values-by-new-value "WEBSITESTORAGESIZE" (str volume-size "Gi")))))
(defn-spec generate-hashfile-volume pred/map-or-seq?
[config flattened-and-reduced-config?]
(replace-common-data "website/website-content-volume.yaml" config))
(defn-spec generate-website-build-cron pred/map-or-seq?
[config flattened-and-reduced-config?]
(replace-build-data "website/website-build-cron.yaml" config))
@ -204,4 +208,5 @@
gitea-host
gitea-repo
username
branchname))))))
branchname))))))

View file

@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: NAME-hashfile-volume
namespace: default
labels:
app: NAME-nginx
app.kubernetes.part-of: NAME-website
spec:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 16Mi

View file

@ -52,6 +52,8 @@ spec:
volumeMounts:
- name: content-volume
mountPath: /var/www/html/website
- name: hashfile-volume
mountPath: /var/hashfile.d
volumes:
- name: nginx-config-volume
configMap:
@ -68,4 +70,7 @@ spec:
- name: content-volume
persistentVolumeClaim:
claimName: NAME-content-volume
- name: hashfile-volume
persistentVolumeClaim:
claimName: NAME-hashfile-volume

View file

@ -35,9 +35,14 @@ spec:
volumeMounts:
- name: content-volume
mountPath: /var/www/html/website
- name: hashfile-volume
mountPath: /var/hashfile.d
volumes:
- name: content-volume
persistentVolumeClaim:
claimName: NAME-content-volume
- name: hashfile-volume
persistentVolumeClaim:
claimName: NAME-hashfile-volume
restartPolicy: OnFailure