From cc97cae0d0bdb0e7b32738766203b60584515ab6 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 22 Feb 2024 13:22:08 +0100 Subject: [PATCH] remove parameter for pre build script --- src/main/cljc/dda/c4k_website/website.cljc | 7 +++---- src/main/resources/website/nginx-deployment.yaml | 5 ----- src/main/resources/website/website-build-cron.yaml | 5 ----- src/test/cljc/dda/c4k_website/website_test.cljc | 3 --- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main/cljc/dda/c4k_website/website.cljc b/src/main/cljc/dda/c4k_website/website.cljc index 0df972f..baaaae1 100644 --- a/src/main/cljc/dda/c4k_website/website.cljc +++ b/src/main/cljc/dda/c4k_website/website.cljc @@ -120,12 +120,10 @@ (defn-spec replace-build-data pred/map-or-seq? [resource-file string? 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] (-> (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_LIMIT" build-cpu-limit) (cm/replace-all-matching-values-by-new-value "BUILD_MEMORY_REQUEST" build-memory-request) @@ -165,7 +163,7 @@ [config websiteconfig?] (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? [config websiteconfig?] (let [{:keys [unique-name fqdns]} config] @@ -188,6 +186,7 @@ [config websiteconfig?] (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? [config websiteconfig? auth websiteauth?] diff --git a/src/main/resources/website/nginx-deployment.yaml b/src/main/resources/website/nginx-deployment.yaml index 9133cd2..1e2a66b 100644 --- a/src/main/resources/website/nginx-deployment.yaml +++ b/src/main/resources/website/nginx-deployment.yaml @@ -44,11 +44,6 @@ spec: envFrom: - secretRef: name: NAME-secret - env: - - name: SHA256SUM - value: CHECK_SUM - - name: SCRIPTFILE - value: SCRIPT_FILE volumeMounts: - name: content-volume mountPath: /var/www/html/website diff --git a/src/main/resources/website/website-build-cron.yaml b/src/main/resources/website/website-build-cron.yaml index 1c79d09..a811e19 100644 --- a/src/main/resources/website/website-build-cron.yaml +++ b/src/main/resources/website/website-build-cron.yaml @@ -27,11 +27,6 @@ spec: envFrom: - secretRef: name: NAME-secret - env: - - name: SHA256SUM - value: CHECK_SUM - - name: SCRIPTFILE - value: SCRIPT_FILE volumeMounts: - name: content-volume mountPath: /var/www/html/website diff --git a/src/test/cljc/dda/c4k_website/website_test.cljc b/src/test/cljc/dda/c4k_website/website_test.cljc index 4487090..797cab7 100644 --- a/src/test/cljc/dda/c4k_website/website_test.cljc +++ b/src/test/cljc/dda/c4k_website/website_test.cljc @@ -72,7 +72,6 @@ :resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}}, :command ["/entrypoint.sh"], :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"} {:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}], :volumes @@ -155,7 +154,6 @@ :resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}}, :command ["/entrypoint.sh"], :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"} {:name "hashfile-volume", :mountPath "/var/hashfile.d"}]}], :volumes [{:name "content-volume", :persistentVolumeClaim {:claimName "test-io-content-volume"}} @@ -164,7 +162,6 @@ (cut/generate-website-build-cron {:forgejo-host "gitlab.de", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :forgejo-repo "repo", - :sha256sum-output "123456789ab123cd345de script-file-name.sh", :issuer "staging", :branchname "main", :unique-name "test.io"}))))