From 2fab2a1335ebb5e2aec2fdad3ac31ed2eb86ed55 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 13 May 2022 15:10:18 +0200 Subject: [PATCH] use new common version --- project.clj | 2 +- shadow-cljs.edn | 2 +- src/main/clj/dda/c4k_shynet/uberjar.clj | 4 ++-- src/main/cljs/dda/c4k_shynet/browser.cljs | 22 ++++++++++------------ valid-config.edn | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/project.clj b/project.clj index d455038..75d8148 100644 --- a/project.clj +++ b/project.clj @@ -5,7 +5,7 @@ :url "https://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.10.3"] [org.clojure/tools.reader "1.3.6"] - [org.domaindrivenarchitecture/c4k-common-clj "1.1.4"] + [org.domaindrivenarchitecture/c4k-common-clj "2.0.1"] [hickory "0.7.1"]] :target-path "target/%s/" :source-paths ["src/main/cljc" diff --git a/shadow-cljs.edn b/shadow-cljs.edn index de12eba..cc54411 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -4,7 +4,7 @@ "src/test/cljc" "src/test/cljs" "src/test/resources"] - :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "1.1.0-SNAPSHOT"] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "2.0.1"] [hickory "0.7.1"]] :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-shynet.browser/init}} diff --git a/src/main/clj/dda/c4k_shynet/uberjar.clj b/src/main/clj/dda/c4k_shynet/uberjar.clj index ff52279..41a60b1 100644 --- a/src/main/clj/dda/c4k_shynet/uberjar.clj +++ b/src/main/clj/dda/c4k_shynet/uberjar.clj @@ -2,7 +2,7 @@ (:gen-class) (:require [dda.c4k-shynet.core :as core] - [dda.c4k-common.common :as common])) + [dda.c4k-common.uberjar :as uberjar])) (defn -main [& cmd-args] - (common/main-common "c4k-shynet" core/config? core/auth? core/config-defaults core/k8s-objects cmd-args)) + (uberjar/main-common "c4k-shynet" core/config? core/auth? core/config-defaults core/k8s-objects cmd-args)) diff --git a/src/main/cljs/dda/c4k_shynet/browser.cljs b/src/main/cljs/dda/c4k_shynet/browser.cljs index cf24cad..e68c7e5 100644 --- a/src/main/cljs/dda/c4k_shynet/browser.cljs +++ b/src/main/cljs/dda/c4k_shynet/browser.cljs @@ -5,12 +5,8 @@ [dda.c4k-shynet.core :as core] [dda.c4k-shynet.shynet :as shynet] [dda.c4k-common.browser :as br] - [dda.c4k-common.postgres :as pgc])) - -;; TODO: Move these fkt up to common -(defn concat-vec [& vs] - (into [] - (apply concat vs))) + [dda.c4k-common.postgres :as pgc] + [dda.c4k-common.common :as cm])) (defn generate-group [name @@ -27,18 +23,18 @@ :content content}]}]) (defn generate-content [] - (concat-vec + (cm/concat-vec [(assoc (br/generate-needs-validation) :content - (concat-vec + (cm/concat-vec (generate-group "domain" - (concat-vec + (cm/concat-vec (br/generate-input-field "fqdn" "Your fqdn:" "shynet.prod.meissa-gmbh.de") (br/generate-input-field "issuer" "(Optional) Your issuer prod/staging:" ""))) (generate-group "provider" - (concat-vec + (cm/concat-vec (br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path if Persistent Volumes are not generated by an Operator:" ""))) (generate-group "credentials" @@ -89,9 +85,11 @@ (.getElementById "generate-button") (.addEventListener "click" #(do (validate-all!) - (-> (core/generate ;TODO: common/generate (?) + (-> (cm/generate-common (config-from-document) - (br/get-content-from-element "auth" :deserializer edn/read-string)) + (br/get-content-from-element "auth" :deserializer edn/read-string) + core/config-defaults + core/k8s-objects) (br/set-output!))))) (add-validate-listener "fqdn") (add-validate-listener "postgres-data-volume-path") diff --git a/valid-config.edn b/valid-config.edn index 98711d3..e261085 100644 --- a/valid-config.edn +++ b/valid-config.edn @@ -1,3 +1,3 @@ {:fqdn "statistics.test.meissa-gmbh.de" - :issuer :staging + :issuer "staging" :postgres-data-volume-path "/var/postgres"}