From 7e146a34631b03e6200924fb1953a255a52d23ba Mon Sep 17 00:00:00 2001 From: Clemens Date: Thu, 7 Mar 2024 12:23:13 +0100 Subject: [PATCH] renamed repo-user and forgejo-repo --- doc/architecture.md | 4 +- src/main/cljc/dda/c4k_website/core.cljc | 8 +-- src/main/cljc/dda/c4k_website/website.cljc | 20 +++---- src/main/cljs/dda/c4k_website/browser.cljs | 8 +-- src/test/cljc/dda/c4k_website/core_test.cljc | 44 ++++++++-------- .../cljc/dda/c4k_website/website_test.cljc | 52 +++++++++---------- .../resources/website-test/valid-config.yaml | 8 +-- 7 files changed, 72 insertions(+), 72 deletions(-) diff --git a/doc/architecture.md b/doc/architecture.md index ca28e46..62d36b9 100644 --- a/doc/architecture.md +++ b/doc/architecture.md @@ -28,12 +28,12 @@ websiteconfigs: - unique-name: "test.io" fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] forgejo-host: "codeberg.org" - forgejo-repo: "repo" + repo-name: "repo" branchname: "main" - unique-name: "example.io" fqdns: ["example.org", "www.example.com"] forgejo-host: "fineForgejoHost.net" - forgejo-repo: "repo" + repo-name: "repo" branchname: "main" mon-cfg: grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" diff --git a/src/main/cljc/dda/c4k_website/core.cljc b/src/main/cljc/dda/c4k_website/core.cljc index 83c63b4..8172e15 100644 --- a/src/main/cljc/dda/c4k_website/core.cljc +++ b/src/main/cljc/dda/c4k_website/core.cljc @@ -20,8 +20,8 @@ (s/def ::authtoken ::web/authtoken) (s/def ::fqdns ::web/fqdns) (s/def ::forgejo-host ::web/forgejo-host) -(s/def ::repo-user ::web/repo-user) -(s/def ::forgejo-repo ::web/forgejo-repo) +(s/def ::repo-owner ::web/repo-owner) +(s/def ::repo-name ::web/repo-name) (s/def ::branchname ::web/branchname) (s/def ::build-cpu-request ::web/build-cpu-request) (s/def ::build-memory-request ::web/build-memory-request) @@ -32,8 +32,8 @@ (def websiteconfig? (s/keys :req-un [::unique-name ::fqdns ::forgejo-host - ::repo-user - ::forgejo-repo + ::repo-owner + ::repo-name ::branchname] :opt-un [::issuer ::volume-size diff --git a/src/main/cljc/dda/c4k_website/website.cljc b/src/main/cljc/dda/c4k_website/website.cljc index 4c61147..c1fbf12 100644 --- a/src/main/cljc/dda/c4k_website/website.cljc +++ b/src/main/cljc/dda/c4k_website/website.cljc @@ -20,9 +20,9 @@ (s/def ::authtoken pred/bash-env-string?) (s/def ::fqdns (s/coll-of pred/fqdn-string?)) (s/def ::forgejo-host pred/fqdn-string?) -(s/def ::forgejo-repo string?) +(s/def ::repo-name string?) (s/def ::branchname string?) -(s/def ::repo-user string?) +(s/def ::repo-owner string?) (s/def ::build-cpu-request string?) (s/def ::build-memory-request string?) (s/def ::build-cpu-limit string?) @@ -33,8 +33,8 @@ (def websiteconfig? (s/keys :req-un [::unique-name ::fqdns ::forgejo-host - ::repo-user - ::forgejo-repo + ::repo-owner + ::repo-name ::branchname ::build-cpu-request ::build-cpu-limit @@ -108,8 +108,8 @@ [config websiteconfig?] (let [{:keys [unique-name forgejo-host - repo-user - forgejo-repo + repo-owner + repo-name branchname]} config name (replace-dots-by-minus unique-name)] (-> @@ -118,13 +118,13 @@ (cm/replace-all-matching-values-by-new-value "GITHOST" forgejo-host) (cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl forgejo-host - repo-user - forgejo-repo + repo-owner + repo-name branchname)) (cm/replace-all-matching-values-by-new-value "COMMITURL" (generate-gitcommiturl forgejo-host - repo-user - forgejo-repo))))) + repo-owner + repo-name))))) (defn-spec generate-build-secret pred/map-or-seq? [auth websiteauth?] diff --git a/src/main/cljs/dda/c4k_website/browser.cljs b/src/main/cljs/dda/c4k_website/browser.cljs index 8ddddc0..cae51b0 100644 --- a/src/main/cljs/dda/c4k_website/browser.cljs +++ b/src/main/cljs/dda/c4k_website/browser.cljs @@ -29,15 +29,15 @@ [{:unique-name \"test.io\", :fqdns [\"test.de\" \"www.test.de\"], :forgejo-host \"githost.de\", - :repo-user \"someuser\", - :forgejo-repo \"repo\", + :repo-owner \"someuser\", + :repo-name \"repo\", :branchname \"main\", :sha256sum-output \"123456789ab123cd345de script-file-name.sh\"} {:unique-name \"example.io \", :fqdns [\"example.org\" \"www.example.org\"], :forgejo-host \"githost.org\", - :repo-user \"someuser\", - :forgejo-repo \"repo\", + :repo-owner \"someuser\", + :repo-name \"repo\", :branchname \"main\", :build-cpu-request \"1500m\", :build-cpu-limit \"3000m\", diff --git a/src/test/cljc/dda/c4k_website/core_test.cljc b/src/test/cljc/dda/c4k_website/core_test.cljc index e028819..4f35f3c 100644 --- a/src/test/cljc/dda/c4k_website/core_test.cljc +++ b/src/test/cljc/dda/c4k_website/core_test.cljc @@ -30,14 +30,14 @@ [{:unique-name "example.io" :fqdns ["example.org", "www.example.com"] :forgejo-host "finegitehost.net" - :repo-user "someuser" - :forgejo-repo "repo" + :repo-owner "someuser" + :repo-name "repo" :branchname "main"} {:unique-name "test.io" :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :forgejo-host "gitlab.de" - :repo-user "someuser" - :forgejo-repo "repo" + :repo-owner "someuser" + :repo-name "repo" :branchname "main"}]}) (def websites2 @@ -45,14 +45,14 @@ [{:unique-name "test.io" :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :forgejo-host "gitlab.de" - :repo-user "someuser" - :forgejo-repo "repo" + :repo-owner "someuser" + :repo-name "repo" :branchname "main"} {:unique-name "example.io" :fqdns ["example.org", "www.example.com"] :forgejo-host "finegitehost.net" - :repo-user "someuser" - :forgejo-repo "repo" + :repo-owner "someuser" + :repo-name "repo" :branchname "main"}]}) (def auth1 @@ -73,8 +73,8 @@ {:unique-name "example.io", :fqdns ["example.org" "www.example.com"], :forgejo-host "finegitehost.net", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :branchname "main"}) (def flattened-and-reduced-auth @@ -87,14 +87,14 @@ [{:unique-name "example.io", :fqdns ["example.org" "www.example.com"], :forgejo-host "finegitehost.net", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :branchname "main"}, {:unique-name "test.io", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :forgejo-host "gitlab.de", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :branchname "main", :sha256sum-output "123456789ab123cd345de script-file-name.sh"}], :mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}} @@ -104,15 +104,15 @@ [{:unique-name "test.io", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :forgejo-host "gitlab.de", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :branchname "main", :sha256sum-output "123456789ab123cd345de script-file-name.sh"} {:unique-name "example.io", :fqdns ["example.org" "www.example.com"], :forgejo-host "finegitehost.net", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :branchname "main"}], :mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}})))) @@ -165,8 +165,8 @@ (cut/generate-ingress {:unique-name "test.io", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :forgejo-host "gitlab.de", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :sha256sum-output "123456789ab123cd345de script-file-name.sh", :issuer "staging", :branchname "main", @@ -182,8 +182,8 @@ (cut/generate-ingress {:unique-name "test.io", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :forgejo-host "gitlab.de", - :repo-user "someuser", - :forgejo-repo "repo", + :repo-owner "someuser", + :repo-name "repo", :sha256sum-output "123456789ab123cd345de script-file-name.sh", :issuer "staging", :branchname "main", diff --git a/src/test/cljc/dda/c4k_website/website_test.cljc b/src/test/cljc/dda/c4k_website/website_test.cljc index 9d7aec5..47a93d9 100644 --- a/src/test/cljc/dda/c4k_website/website_test.cljc +++ b/src/test/cljc/dda/c4k_website/website_test.cljc @@ -39,8 +39,8 @@ :redirects [["/products.html", "/offer.html"] ["/one-more", "/redirect"]] :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} 2))) @@ -54,8 +54,8 @@ :unique-name "test.io", :redirects [] :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} 0)))) @@ -64,9 +64,9 @@ (deftest should-generate-resource-requests (is (= {:requests {:cpu "1500m", :memory "512Mi"}, :limits {:cpu "3000m", :memory "1024Mi"}} (-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", - :repo-user "someuser", + :repo-owner "someuser", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], - :forgejo-repo "repo", + :repo-name "repo", :issuer "staging", :branchname "main", :unique-name "test.io", @@ -79,9 +79,9 @@ :spec :template :spec :initContainers first :resources))) (is (= "test-io" (-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", - :repo-user "someuser", + :repo-owner "someuser", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], - :forgejo-repo "repo", + :repo-name "repo", :issuer "staging", :branchname "main", :unique-name "test.io", @@ -104,8 +104,8 @@ :redirects [["/products.html", "/offer.html"] ["/one-more", "/redirect"]] :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) " /offer.html permanent;\n")) @@ -120,8 +120,8 @@ :redirects [["/products.html", "/offer.html"] ["/one-more", "/redirect"]] :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) " /redirect permanent;\n")) @@ -135,8 +135,8 @@ :unique-name "test.io", :redirects [], :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) "server_name test.de www.test.de test-it.de www.test-it.de;")) @@ -154,8 +154,8 @@ :unique-name "test.io", :redirects [], :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}) :data)))) @@ -178,8 +178,8 @@ :unique-name "test.io", :redirects [], :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) @@ -222,9 +222,9 @@ :build-memory-limit "512Mi" :volume-size "3" :forgejo-host "gitlab.de", - :repo-user "someuser", + :repo-owner "someuser", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], - :forgejo-repo "repo", + :repo-name "repo", :branchname "main", :unique-name "test.io", :redirects []})))) @@ -246,9 +246,9 @@ :build-memory-limit "512Mi" :volume-size "3" :forgejo-host "mygit.de", - :repo-user "someuser", + :repo-owner "someuser", :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], - :forgejo-repo "repo", + :repo-name "repo", :branchname "main", :unique-name "test.io", :redirects []})))) @@ -284,8 +284,8 @@ :unique-name "test.io", :redirects [], :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) @@ -309,7 +309,7 @@ :unique-name "test.io", :redirects [], :forgejo-host "gitea.evilorg", - :repo-user "someuser", - :forgejo-repo "none", + :repo-owner "someuser", + :repo-name "none", :branchname "mablain", :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) \ No newline at end of file diff --git a/src/test/resources/website-test/valid-config.yaml b/src/test/resources/website-test/valid-config.yaml index 6d0028a..141944b 100644 --- a/src/test/resources/website-test/valid-config.yaml +++ b/src/test/resources/website-test/valid-config.yaml @@ -3,8 +3,8 @@ websiteconfigs: - unique-name: "test.io" fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] forgejo-host: "codeberg.org" - repo-user: "someuser" - forgejo-repo: "repo" + repo-owner: "someuser" + repo-name: "repo" branchname: "main" redirects: - ["/products.html", "/offer.html"] @@ -12,8 +12,8 @@ websiteconfigs: - unique-name: "example.io" fqdns: ["example.org", "www.example.com"] forgejo-host: "fineForgejoHost.net" - repo-user: "someotheruser" - forgejo-repo: "repo" + repo-owner: "someotheruser" + repo-name: "repo" branchname: "main" mon-cfg: grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"