[Skip-CI] WIP add hashfile storage
This commit is contained in:
parent
8c98c3eb8f
commit
f126035e84
6 changed files with 36 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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))
|
||||||
|
@ -205,3 +209,4 @@
|
||||||
gitea-repo
|
gitea-repo
|
||||||
username
|
username
|
||||||
branchname))))))
|
branchname))))))
|
||||||
|
|
||||||
|
|
16
src/main/resources/website/hashfile-volume.yaml
Normal file
16
src/main/resources/website/hashfile-volume.yaml
Normal 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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue