One failure remaining in Testdriven Design; Decision if federated true/false in forgejo.cljc not working

This commit is contained in:
Mirco 2023-06-01 20:27:56 +02:00
parent 75d3427893
commit 0f626a040d
2 changed files with 15 additions and 6 deletions

View file

@ -72,9 +72,11 @@
mailer-host mailer-host
mailer-port mailer-port
service-domain-whitelist service-domain-whitelist
service-noreply-address] service-noreply-address
federated]
:or {default-app-name "forgejo instance" :or {default-app-name "forgejo instance"
service-domain-whitelist fqdn}} service-domain-whitelist fqdn
federated false}}
config] config]
(-> (->
(yaml/load-as-edn "forgejo/appini-env-configmap.yaml") (yaml/load-as-edn "forgejo/appini-env-configmap.yaml")
@ -85,7 +87,8 @@
(cm/replace-all-matching-values-by-new-value "MAILERHOST" mailer-host) (cm/replace-all-matching-values-by-new-value "MAILERHOST" mailer-host)
(cm/replace-all-matching-values-by-new-value "MAILERPORT" mailer-port) (cm/replace-all-matching-values-by-new-value "MAILERPORT" mailer-port)
(cm/replace-all-matching-values-by-new-value "WHITELISTDOMAINS" service-domain-whitelist) (cm/replace-all-matching-values-by-new-value "WHITELISTDOMAINS" service-domain-whitelist)
(cm/replace-all-matching-values-by-new-value "NOREPLY" service-noreply-address)))) (cm/replace-all-matching-values-by-new-value "NOREPLY" service-noreply-address)
(cm/replace-all-matching-values-by-new-value "FEDERATED" (str federated)))))
(defn generate-secrets (defn generate-secrets
[auth] [auth]
@ -120,8 +123,14 @@
; ToDo: Need to add federated-image-name to config? Or hardcode? ; ToDo: Need to add federated-image-name to config? Or hardcode?
; ToDo: Need to add default image-name to config? Or hardcode? ; ToDo: Need to add default image-name to config? Or hardcode?
(defn-spec generate-deployment pred/map-or-seq? (defn-spec generate-deployment pred/map-or-seq?
[config config?] [config]
(yaml/load-as-edn "forgejo/deployment.yaml")) (let [{:keys [federated]} config]
; TODO: if
if (= federated true)
(->
(yaml/load-as-edn "forgejo/deployment.yaml")
(cm/replace-all-matching-values-by-new-value "codeberg.org/forgejo/forgejo:1.19" "domaindrivenarchitecture/c4k-forgejo-fed"))))
(defn generate-service (defn generate-service
[] []

View file

@ -24,7 +24,7 @@ data:
RUN_USER: git RUN_USER: git
#[federation] #[federation]
FORGEJO__federation__ENABLED: "true" FORGEJO__federation__ENABLED: FEDERATED
#[indexer] #[indexer]
FORGEJO__indexer__ISSUE_INDEXER_PATH: /data/gitea/indexers/issues.bleve FORGEJO__indexer__ISSUE_INDEXER_PATH: /data/gitea/indexers/issues.bleve