create yaml from all base yamls

This commit is contained in:
bom 2021-07-02 16:18:51 +02:00
parent 1c55bed971
commit 1d81949768
4 changed files with 28 additions and 2 deletions

View file

@ -19,4 +19,14 @@
my-auth auth?] my-auth auth?]
(let [resulting-config (merge config-defaults my-config)] (let [resulting-config (merge config-defaults my-config)]
(cs/join "\n" (cs/join "\n"
[]))) [(yaml/to-string (jira/generate-persistent-volume))
"---"
(yaml/to-string (jira/generate-pvc))
"---"
(yaml/to-string (jira/generate-certificate resulting-config))
"---"
(yaml/to-string (jira/generate-ingress resulting-config))
"---"
(yaml/to-string (jira/generate-service))
"---"
(yaml/to-string (jira/generate-pod resulting-config))])))

View file

@ -5,6 +5,8 @@
[dda.c4k-common.base64 :as b64] [dda.c4k-common.base64 :as b64]
[dda.c4k-common.common :as cm])) [dda.c4k-common.common :as cm]))
(s/def ::db-user-name cm/bash-env-string?)
(s/def ::db-user-password cm/bash-env-string?)
(s/def ::fqdn cm/fqdn-string?) (s/def ::fqdn cm/fqdn-string?)
(s/def ::issuer cm/letsencrypt-issuer?) (s/def ::issuer cm/letsencrypt-issuer?)
@ -26,3 +28,17 @@
(yaml/from-string (yaml/load-resource "jira/ingress.yaml")) (yaml/from-string (yaml/load-resource "jira/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer) (assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)
(cm/replace-all-matching-values-by-new-value "fqdn" fqdn)))) (cm/replace-all-matching-values-by-new-value "fqdn" fqdn))))
(defn generate-persistent-volume []
(yaml/from-string (yaml/load-resource "jira/persistent-volume.yaml")))
(defn generate-pvc []
(yaml/from-string (yaml/load-resource "jira/pvc.yaml")))
(defn generate-service []
(yaml/from-string (yaml/load-resource "jira/service.yaml")))
(defn generate-pod [config]
(let [{:keys [fqdn db-user-name db-user-password]}]
(-> (yaml/from-string (yaml/load-resource "jira/pod.yaml"))
(assoc-in [:spec :containers :args] [fqdn, db-user-name, db-user-password]))))

View file

@ -10,7 +10,7 @@ spec:
image: domaindrivenarchitecture/meissa-jira-crate image: domaindrivenarchitecture/meissa-jira-crate
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: ["/app/entrypoint.sh"] command: ["/app/entrypoint.sh"]
args: ["{{fqdn}}", "{{db-user-name}}", "{{db-user-password}}"] args: ["fqdn", "db-user-name", "db-user-password"]
volumeMounts: volumeMounts:
- mountPath: /var/jira - mountPath: /var/jira
name: jira-data-volume name: jira-data-volume