feature/improve-start-script #2
4 changed files with 3 additions and 17 deletions
|
@ -120,12 +120,10 @@
|
||||||
(defn-spec replace-build-data pred/map-or-seq?
|
(defn-spec replace-build-data pred/map-or-seq?
|
||||||
[resource-file string?
|
[resource-file string?
|
||||||
config websiteconfig?]
|
config websiteconfig?]
|
||||||
(let [{:keys [sha256sum-output build-cpu-request build-cpu-limit build-memory-request build-memory-limit]
|
(let [{:keys [build-cpu-request build-cpu-limit build-memory-request build-memory-limit]
|
||||||
:or {build-cpu-request "500m" build-cpu-limit "1700m" build-memory-request "256Mi" build-memory-limit "512Mi"}} config]
|
:or {build-cpu-request "500m" build-cpu-limit "1700m" build-memory-request "256Mi" build-memory-limit "512Mi"}} config]
|
||||||
(->
|
(->
|
||||||
(replace-common-data resource-file config)
|
(replace-common-data resource-file config)
|
||||||
(cm/replace-all-matching-values-by-new-value "CHECK_SUM" (get-hash-from-sha256sum-output sha256sum-output))
|
|
||||||
(cm/replace-all-matching-values-by-new-value "SCRIPT_FILE" (get-file-name-from-sha256sum-output sha256sum-output))
|
|
||||||
(cm/replace-all-matching-values-by-new-value "BUILD_CPU_REQUEST" build-cpu-request)
|
(cm/replace-all-matching-values-by-new-value "BUILD_CPU_REQUEST" build-cpu-request)
|
||||||
(cm/replace-all-matching-values-by-new-value "BUILD_CPU_LIMIT" build-cpu-limit)
|
(cm/replace-all-matching-values-by-new-value "BUILD_CPU_LIMIT" build-cpu-limit)
|
||||||
(cm/replace-all-matching-values-by-new-value "BUILD_MEMORY_REQUEST" build-memory-request)
|
(cm/replace-all-matching-values-by-new-value "BUILD_MEMORY_REQUEST" build-memory-request)
|
||||||
|
@ -165,7 +163,7 @@
|
||||||
[config websiteconfig?]
|
[config websiteconfig?]
|
||||||
(replace-common-data "website/hashfile-volume.yaml" config))
|
(replace-common-data "website/hashfile-volume.yaml" config))
|
||||||
|
|
||||||
|
; using simple ingress instead removes the need of cert handling
|
||||||
(defn-spec generate-website-ingress pred/map-or-seq?
|
(defn-spec generate-website-ingress pred/map-or-seq?
|
||||||
[config websiteconfig?]
|
[config websiteconfig?]
|
||||||
(let [{:keys [unique-name fqdns]} config]
|
(let [{:keys [unique-name fqdns]} config]
|
||||||
|
@ -188,6 +186,7 @@
|
||||||
[config websiteconfig?]
|
[config websiteconfig?]
|
||||||
(replace-build-data "website/website-build-cron.yaml" config))
|
(replace-build-data "website/website-build-cron.yaml" config))
|
||||||
|
|
||||||
|
; TODO: repo & commit-url sounds more like config map?
|
||||||
(defn-spec generate-website-build-secret pred/map-or-seq?
|
(defn-spec generate-website-build-secret pred/map-or-seq?
|
||||||
[config websiteconfig?
|
[config websiteconfig?
|
||||||
auth websiteauth?]
|
auth websiteauth?]
|
||||||
|
|
|
@ -44,11 +44,6 @@ spec:
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: NAME-secret
|
name: NAME-secret
|
||||||
env:
|
|
||||||
- name: SHA256SUM
|
|
||||||
value: CHECK_SUM
|
|
||||||
- name: SCRIPTFILE
|
|
||||||
value: SCRIPT_FILE
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: content-volume
|
- name: content-volume
|
||||||
mountPath: /var/www/html/website
|
mountPath: /var/www/html/website
|
||||||
|
|
|
@ -27,11 +27,6 @@ spec:
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: NAME-secret
|
name: NAME-secret
|
||||||
env:
|
|
||||||
- name: SHA256SUM
|
|
||||||
value: CHECK_SUM
|
|
||||||
- name: SCRIPTFILE
|
|
||||||
value: SCRIPT_FILE
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: content-volume
|
- name: content-volume
|
||||||
mountPath: /var/www/html/website
|
mountPath: /var/www/html/website
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
:resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}},
|
:resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}},
|
||||||
:command ["/entrypoint.sh"],
|
:command ["/entrypoint.sh"],
|
||||||
:envFrom [{:secretRef {:name "test-io-secret"}}],
|
:envFrom [{:secretRef {:name "test-io-secret"}}],
|
||||||
:env [{:name "SHA256SUM", :value "123456789ab123cd345de"} {:name "SCRIPTFILE", :value "script-file-name.sh"}],
|
|
||||||
:volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"}
|
:volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"}
|
||||||
{:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}],
|
{:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}],
|
||||||
:volumes
|
:volumes
|
||||||
|
@ -155,7 +154,6 @@
|
||||||
:resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}},
|
:resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}},
|
||||||
:command ["/entrypoint.sh"],
|
:command ["/entrypoint.sh"],
|
||||||
:envFrom [{:secretRef {:name "test-io-secret"}}],
|
:envFrom [{:secretRef {:name "test-io-secret"}}],
|
||||||
:env [{:name "SHA256SUM", :value "123456789ab123cd345de"} {:name "SCRIPTFILE", :value "script-file-name.sh"}],
|
|
||||||
:volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"}
|
:volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"}
|
||||||
{:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}],
|
{:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}],
|
||||||
:volumes [{:name "content-volume", :persistentVolumeClaim {:claimName "test-io-content-volume"}}
|
:volumes [{:name "content-volume", :persistentVolumeClaim {:claimName "test-io-content-volume"}}
|
||||||
|
@ -164,7 +162,6 @@
|
||||||
(cut/generate-website-build-cron {:forgejo-host "gitlab.de",
|
(cut/generate-website-build-cron {:forgejo-host "gitlab.de",
|
||||||
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
|
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
|
||||||
:forgejo-repo "repo",
|
:forgejo-repo "repo",
|
||||||
:sha256sum-output "123456789ab123cd345de script-file-name.sh",
|
|
||||||
:issuer "staging",
|
:issuer "staging",
|
||||||
:branchname "main",
|
:branchname "main",
|
||||||
:unique-name "test.io"}))))
|
:unique-name "test.io"}))))
|
||||||
|
|
Loading…
Reference in a new issue