[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 # Prepare Entrypoint Script
ADD resources /tmp ADD resources /tmp
ENV SOURCEDIR="/etc/websitesource"
ENV BUILDDIR="/etc/website" ENV BUILDDIR="/etc/website"
ENV SOURCEDIR="/etc/websitesource"
ENV WEBSITEROOT="/var/www/html/website/" ENV WEBSITEROOT="/var/www/html/website/"
ENV HASHFILEDIR="/data/hashfiles" ENV HASHFILEDIR="/var/hashfile.d"
RUN /tmp/install.sh RUN /tmp/install.sh

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/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 $BUILDDIR
mkdir $SOURCEDIR mkdir $SOURCEDIR
mkdir -p $HASHFILEDIR
set -o nounset set -o nounset
set -o xtrace set -o xtrace
@ -14,8 +14,8 @@ source /usr/local/bin/functions.sh
filename="website.zip" filename="website.zip"
hashfilename="hashfile" hashfilename="hashfile"
# create empty hashfile
# download website data # download website data
# create empty hashfile
# compare current hash to hashfile # compare current hash to hashfile
# same? # same?
# do nothing # do nothing

View file

@ -185,6 +185,10 @@
(replace-common-data "website/website-content-volume.yaml" config) (replace-common-data "website/website-content-volume.yaml" config)
(cm/replace-all-matching-values-by-new-value "WEBSITESTORAGESIZE" (str volume-size "Gi"))))) (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? (defn-spec generate-website-build-cron pred/map-or-seq?
[config flattened-and-reduced-config?] [config flattened-and-reduced-config?]
(replace-build-data "website/website-build-cron.yaml" config)) (replace-build-data "website/website-build-cron.yaml" config))
@ -204,4 +208,5 @@
gitea-host gitea-host
gitea-repo gitea-repo
username 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: volumeMounts:
- name: content-volume - name: content-volume
mountPath: /var/www/html/website mountPath: /var/www/html/website
- name: hashfile-volume
mountPath: /var/hashfile.d
volumes: volumes:
- name: nginx-config-volume - name: nginx-config-volume
configMap: configMap:
@ -68,4 +70,7 @@ spec:
- name: content-volume - name: content-volume
persistentVolumeClaim: persistentVolumeClaim:
claimName: NAME-content-volume claimName: NAME-content-volume
- name: hashfile-volume
persistentVolumeClaim:
claimName: NAME-hashfile-volume

View file

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