renamed repo-user and forgejo-repo

This commit is contained in:
Clemens 2024-03-07 12:23:13 +01:00
parent 164f66d4b7
commit 7e146a3463
7 changed files with 72 additions and 72 deletions

View file

@ -28,12 +28,12 @@ websiteconfigs:
- unique-name: "test.io" - unique-name: "test.io"
fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"]
forgejo-host: "codeberg.org" forgejo-host: "codeberg.org"
forgejo-repo: "repo" repo-name: "repo"
branchname: "main" branchname: "main"
- unique-name: "example.io" - unique-name: "example.io"
fqdns: ["example.org", "www.example.com"] fqdns: ["example.org", "www.example.com"]
forgejo-host: "fineForgejoHost.net" forgejo-host: "fineForgejoHost.net"
forgejo-repo: "repo" repo-name: "repo"
branchname: "main" branchname: "main"
mon-cfg: mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"

View file

@ -20,8 +20,8 @@
(s/def ::authtoken ::web/authtoken) (s/def ::authtoken ::web/authtoken)
(s/def ::fqdns ::web/fqdns) (s/def ::fqdns ::web/fqdns)
(s/def ::forgejo-host ::web/forgejo-host) (s/def ::forgejo-host ::web/forgejo-host)
(s/def ::repo-user ::web/repo-user) (s/def ::repo-owner ::web/repo-owner)
(s/def ::forgejo-repo ::web/forgejo-repo) (s/def ::repo-name ::web/repo-name)
(s/def ::branchname ::web/branchname) (s/def ::branchname ::web/branchname)
(s/def ::build-cpu-request ::web/build-cpu-request) (s/def ::build-cpu-request ::web/build-cpu-request)
(s/def ::build-memory-request ::web/build-memory-request) (s/def ::build-memory-request ::web/build-memory-request)
@ -32,8 +32,8 @@
(def websiteconfig? (s/keys :req-un [::unique-name (def websiteconfig? (s/keys :req-un [::unique-name
::fqdns ::fqdns
::forgejo-host ::forgejo-host
::repo-user ::repo-owner
::forgejo-repo ::repo-name
::branchname] ::branchname]
:opt-un [::issuer :opt-un [::issuer
::volume-size ::volume-size

View file

@ -20,9 +20,9 @@
(s/def ::authtoken pred/bash-env-string?) (s/def ::authtoken pred/bash-env-string?)
(s/def ::fqdns (s/coll-of pred/fqdn-string?)) (s/def ::fqdns (s/coll-of pred/fqdn-string?))
(s/def ::forgejo-host 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 ::branchname string?)
(s/def ::repo-user string?) (s/def ::repo-owner string?)
(s/def ::build-cpu-request string?) (s/def ::build-cpu-request string?)
(s/def ::build-memory-request string?) (s/def ::build-memory-request string?)
(s/def ::build-cpu-limit string?) (s/def ::build-cpu-limit string?)
@ -33,8 +33,8 @@
(def websiteconfig? (s/keys :req-un [::unique-name (def websiteconfig? (s/keys :req-un [::unique-name
::fqdns ::fqdns
::forgejo-host ::forgejo-host
::repo-user ::repo-owner
::forgejo-repo ::repo-name
::branchname ::branchname
::build-cpu-request ::build-cpu-request
::build-cpu-limit ::build-cpu-limit
@ -108,8 +108,8 @@
[config websiteconfig?] [config websiteconfig?]
(let [{:keys [unique-name (let [{:keys [unique-name
forgejo-host forgejo-host
repo-user repo-owner
forgejo-repo repo-name
branchname]} config branchname]} config
name (replace-dots-by-minus unique-name)] 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 "GITHOST" forgejo-host)
(cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl (cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl
forgejo-host forgejo-host
repo-user repo-owner
forgejo-repo repo-name
branchname)) branchname))
(cm/replace-all-matching-values-by-new-value "COMMITURL" (generate-gitcommiturl (cm/replace-all-matching-values-by-new-value "COMMITURL" (generate-gitcommiturl
forgejo-host forgejo-host
repo-user repo-owner
forgejo-repo))))) repo-name)))))
(defn-spec generate-build-secret pred/map-or-seq? (defn-spec generate-build-secret pred/map-or-seq?
[auth websiteauth?] [auth websiteauth?]

View file

@ -29,15 +29,15 @@
[{:unique-name \"test.io\", [{:unique-name \"test.io\",
:fqdns [\"test.de\" \"www.test.de\"], :fqdns [\"test.de\" \"www.test.de\"],
:forgejo-host \"githost.de\", :forgejo-host \"githost.de\",
:repo-user \"someuser\", :repo-owner \"someuser\",
:forgejo-repo \"repo\", :repo-name \"repo\",
:branchname \"main\", :branchname \"main\",
:sha256sum-output \"123456789ab123cd345de script-file-name.sh\"} :sha256sum-output \"123456789ab123cd345de script-file-name.sh\"}
{:unique-name \"example.io \", {:unique-name \"example.io \",
:fqdns [\"example.org\" \"www.example.org\"], :fqdns [\"example.org\" \"www.example.org\"],
:forgejo-host \"githost.org\", :forgejo-host \"githost.org\",
:repo-user \"someuser\", :repo-owner \"someuser\",
:forgejo-repo \"repo\", :repo-name \"repo\",
:branchname \"main\", :branchname \"main\",
:build-cpu-request \"1500m\", :build-cpu-request \"1500m\",
:build-cpu-limit \"3000m\", :build-cpu-limit \"3000m\",

View file

@ -30,14 +30,14 @@
[{:unique-name "example.io" [{:unique-name "example.io"
:fqdns ["example.org", "www.example.com"] :fqdns ["example.org", "www.example.com"]
:forgejo-host "finegitehost.net" :forgejo-host "finegitehost.net"
:repo-user "someuser" :repo-owner "someuser"
:forgejo-repo "repo" :repo-name "repo"
:branchname "main"} :branchname "main"}
{:unique-name "test.io" {:unique-name "test.io"
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"]
:forgejo-host "gitlab.de" :forgejo-host "gitlab.de"
:repo-user "someuser" :repo-owner "someuser"
:forgejo-repo "repo" :repo-name "repo"
:branchname "main"}]}) :branchname "main"}]})
(def websites2 (def websites2
@ -45,14 +45,14 @@
[{:unique-name "test.io" [{:unique-name "test.io"
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"]
:forgejo-host "gitlab.de" :forgejo-host "gitlab.de"
:repo-user "someuser" :repo-owner "someuser"
:forgejo-repo "repo" :repo-name "repo"
:branchname "main"} :branchname "main"}
{:unique-name "example.io" {:unique-name "example.io"
:fqdns ["example.org", "www.example.com"] :fqdns ["example.org", "www.example.com"]
:forgejo-host "finegitehost.net" :forgejo-host "finegitehost.net"
:repo-user "someuser" :repo-owner "someuser"
:forgejo-repo "repo" :repo-name "repo"
:branchname "main"}]}) :branchname "main"}]})
(def auth1 (def auth1
@ -73,8 +73,8 @@
{:unique-name "example.io", {:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:branchname "main"}) :branchname "main"})
(def flattened-and-reduced-auth (def flattened-and-reduced-auth
@ -87,14 +87,14 @@
[{:unique-name "example.io", [{:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:branchname "main"}, :branchname "main"},
{:unique-name "test.io", {:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:branchname "main", :branchname "main",
:sha256sum-output "123456789ab123cd345de script-file-name.sh"}], :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"}} :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", [{:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:branchname "main", :branchname "main",
:sha256sum-output "123456789ab123cd345de script-file-name.sh"} :sha256sum-output "123456789ab123cd345de script-file-name.sh"}
{:unique-name "example.io", {:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:branchname "main"}], :branchname "main"}],
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}})))) :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", (cut/generate-ingress {:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:sha256sum-output "123456789ab123cd345de script-file-name.sh", :sha256sum-output "123456789ab123cd345de script-file-name.sh",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
@ -182,8 +182,8 @@
(cut/generate-ingress {:unique-name "test.io", (cut/generate-ingress {:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "repo", :repo-name "repo",
:sha256sum-output "123456789ab123cd345de script-file-name.sh", :sha256sum-output "123456789ab123cd345de script-file-name.sh",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",

View file

@ -39,8 +39,8 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}
2))) 2)))
@ -54,8 +54,8 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [] :redirects []
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}
0)))) 0))))
@ -64,9 +64,9 @@
(deftest should-generate-resource-requests (deftest should-generate-resource-requests
(is (= {:requests {:cpu "1500m", :memory "512Mi"}, :limits {:cpu "3000m", :memory "1024Mi"}} (is (= {:requests {:cpu "1500m", :memory "512Mi"}, :limits {:cpu "3000m", :memory "1024Mi"}}
(-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", (-> (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"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-repo "repo", :repo-name "repo",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
@ -79,9 +79,9 @@
:spec :template :spec :initContainers first :resources))) :spec :template :spec :initContainers first :resources)))
(is (= "test-io" (is (= "test-io"
(-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", (-> (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"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-repo "repo", :repo-name "repo",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
@ -104,8 +104,8 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))
" /offer.html permanent;\n")) " /offer.html permanent;\n"))
@ -120,8 +120,8 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))
" /redirect permanent;\n")) " /redirect permanent;\n"))
@ -135,8 +135,8 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :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;")) "server_name test.de www.test.de test-it.de www.test-it.de;"))
@ -154,8 +154,8 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})
:data)))) :data))))
@ -178,8 +178,8 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))
@ -222,9 +222,9 @@
:build-memory-limit "512Mi" :build-memory-limit "512Mi"
:volume-size "3" :volume-size "3"
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-user "someuser", :repo-owner "someuser",
: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", :repo-name "repo",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
:redirects []})))) :redirects []}))))
@ -246,9 +246,9 @@
:build-memory-limit "512Mi" :build-memory-limit "512Mi"
:volume-size "3" :volume-size "3"
:forgejo-host "mygit.de", :forgejo-host "mygit.de",
:repo-user "someuser", :repo-owner "someuser",
: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", :repo-name "repo",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
:redirects []})))) :redirects []}))))
@ -284,8 +284,8 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))
@ -309,7 +309,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-user "someuser", :repo-owner "someuser",
:forgejo-repo "none", :repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))

View file

@ -3,8 +3,8 @@ websiteconfigs:
- unique-name: "test.io" - unique-name: "test.io"
fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"]
forgejo-host: "codeberg.org" forgejo-host: "codeberg.org"
repo-user: "someuser" repo-owner: "someuser"
forgejo-repo: "repo" repo-name: "repo"
branchname: "main" branchname: "main"
redirects: redirects:
- ["/products.html", "/offer.html"] - ["/products.html", "/offer.html"]
@ -12,8 +12,8 @@ websiteconfigs:
- unique-name: "example.io" - unique-name: "example.io"
fqdns: ["example.org", "www.example.com"] fqdns: ["example.org", "www.example.com"]
forgejo-host: "fineForgejoHost.net" forgejo-host: "fineForgejoHost.net"
repo-user: "someotheruser" repo-owner: "someotheruser"
forgejo-repo: "repo" repo-name: "repo"
branchname: "main" branchname: "main"
mon-cfg: mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"