improve uberjar

This commit is contained in:
jerger 2022-12-26 18:37:24 +01:00
parent 7ebad4d1d6
commit 81e3e8ed05
3 changed files with 18 additions and 22 deletions

View file

@ -11,5 +11,5 @@
jitsi/config? jitsi/config?
jitsi/auth? jitsi/auth?
core/config-defaults core/config-defaults
core/generate core/k8s-objects
cmd-args)) cmd-args))

View file

@ -4,27 +4,21 @@
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
#?(:clj [orchestra.core :refer [defn-spec]] #?(:clj [orchestra.core :refer [defn-spec]]
:cljs [orchestra.core :refer-macros [defn-spec]]) :cljs [orchestra.core :refer-macros [defn-spec]])
[dda.c4k-common.common :as cm]
[dda.c4k-common.yaml :as yaml] [dda.c4k-common.yaml :as yaml]
[dda.c4k-jitsi.jitsi :as jitsi])) [dda.c4k-jitsi.jitsi :as jitsi]))
(def config-defaults {:issuer :staging}) (def config-defaults {:issuer "staging"})
(defn k8s-objects [config] (defn k8s-objects [config auth]
(map yaml/to-string (map yaml/to-string
[(jitsi/generate-secret-jitsi config) (filter
(jitsi/generate-certificate-jitsi config) #(not (nil? %))
(jitsi/generate-certificate-etherpad config) (cm/concat-vec
[(jitsi/generate-secret-jitsi auth)
(jitsi/generate-jvb-service) (jitsi/generate-jvb-service)
(jitsi/generate-web-service) (jitsi/generate-web-service)
(jitsi/generate-etherpad-service) (jitsi/generate-etherpad-service)
(jitsi/generate-ingress-jitsi config) (jitsi/generate-deployment config)]
(jitsi/generate-ingress-etherpad config) (jitsi/generate-ingress-web config)
(jitsi/generate-deployment config)])) (jitsi/generate-ingress-etherpad config)))))
(defn-spec generate any?
[my-config jitsi/config?
my-auth jitsi/auth?]
(cm/concat-vec
(map yaml/to-string
(filter #(not (nil? %))
(merge config-defaults my-config my-auth)))))

View file

@ -57,9 +57,11 @@
(.getElementById "generate-button") (.getElementById "generate-button")
(.addEventListener "click" (.addEventListener "click"
#(do (validate-all!) #(do (validate-all!)
(-> (core/generate (-> (cm/generate-common
(config-from-document) (config-from-document)
(br/get-content-from-element "auth" :deserializer edn/read-string)) (br/get-content-from-element "auth" :deserializer edn/read-string)
{}
core/k8s-objects)
(br/set-output!))))) (br/set-output!)))))
(add-validate-listener "fqdn") (add-validate-listener "fqdn")
(add-validate-listener "issuer") (add-validate-listener "issuer")