Added generate deployment

This commit is contained in:
Clemens Geibel 2021-03-05 16:48:13 +01:00
parent d869ca7eee
commit d6e99a5230
3 changed files with 13 additions and 2 deletions

View file

@ -22,7 +22,14 @@
(assoc-in [ :data :credentials.edn] (str my-auth)) (assoc-in [ :data :credentials.edn] (str my-auth))
)) ))
(defn generate-deployment []
(->
(yaml/from-string (yaml/load-resource "deployment.yaml"))))
(defn generate [my-config my-auth] (defn generate [my-config my-auth]
(yaml/to-string (generate-config my-config my-auth))) (cs/join "\n"
[(yaml/to-string (generate-config my-config my-auth))
"---"
(yaml/to-string (generate-deployment))]))

View file

@ -6,8 +6,12 @@
(def config (rc/inline "config.yaml")) (def config (rc/inline "config.yaml"))
(def deployment (rc/inline "deployment.yaml"))
(defn load-resource [resource-name] (defn load-resource [resource-name]
config) (case resource-name
"config.yaml" config
"deployment.yaml" deployment))
(defn from-string [input] (defn from-string [input]
(js->clj (yaml/load input) (js->clj (yaml/load input)