Make replacing simpler

This commit is contained in:
erik 2023-06-07 11:38:47 +02:00
parent 4f6cb38101
commit 4c7549c10c

View file

@ -91,9 +91,10 @@
(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)
#(if deploy-federated-bool (cm/replace-all-matching-values-by-new-value "IS_FEDERATED"
(cm/replace-all-matching-values-by-new-value % "IS_FEDERATED" "true") (if deploy-federated-bool
(cm/replace-all-matching-values-by-new-value % "IS_FEDERATED" "false"))))) "true"
"false")))))
(defn generate-secrets (defn generate-secrets
[auth] [auth]
@ -132,9 +133,10 @@
deploy-federated-bool (boolean (Boolean/valueOf deploy-federated))] deploy-federated-bool (boolean (Boolean/valueOf deploy-federated))]
(-> (->
(yaml/load-as-edn "forgejo/deployment.yaml") (yaml/load-as-edn "forgejo/deployment.yaml")
#(if deploy-federated-bool (cm/replace-all-matching-values-by-new-value "IMAGE_NAME"
(cm/replace-all-matching-values-by-new-value % "IMAGE_NAME" federated-image-name) (if deploy-federated-bool
(cm/replace-all-matching-values-by-new-value % "IMAGE_NAME" non-federated-image-name))))) federated-image-name
non-federated-image-name)))))
(defn generate-service (defn generate-service
[] []