Implement inline resources

This commit is contained in:
patdyn 2024-07-04 10:47:18 +02:00
parent 8bcea1ef8f
commit dda4ecb1fb
3 changed files with 4 additions and 8 deletions

View file

@ -5,7 +5,7 @@
:url "https://www.apache.org/licenses/LICENSE-2.0.html"} :url "https://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.11.1"] :dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/tools.reader "1.3.6"] [org.clojure/tools.reader "1.3.6"]
[org.domaindrivenarchitecture/c4k-common-clj "6.0.1"]] [org.domaindrivenarchitecture/c4k-common-clj "6.1.0"]]
:target-path "target/%s/" :target-path "target/%s/"
:source-paths ["src/main/cljc" :source-paths ["src/main/cljc"
"src/main/clj"] "src/main/clj"]

View file

@ -4,7 +4,7 @@
"src/test/cljc" "src/test/cljc"
"src/test/cljs" "src/test/cljs"
"src/test/resources"] "src/test/resources"]
:dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.0.1"] :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.1.0"]
[hickory "0.7.1"]] [hickory "0.7.1"]]
:builds {:frontend {:target :browser :builds {:frontend {:target :browser
:modules {:main {:init-fn dda.c4k-keycloak.browser/init}} :modules {:main {:init-fn dda.c4k-keycloak.browser/init}}

View file

@ -1,7 +1,7 @@
(ns dda.c4k-keycloak.keycloak (ns dda.c4k-keycloak.keycloak
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
#?(:cljs [shadow.resource :as rc]) #?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]])
#?(: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.yaml :as yaml] [dda.c4k-common.yaml :as yaml]
@ -23,11 +23,7 @@
#?(:cljs #?(:cljs
(defmethod yaml/load-resource :keycloak [resource-name] (defmethod yaml/load-resource :keycloak [resource-name]
(case resource-name (get (inline-resources "keycloak") resource-name)))
"keycloak/deployment.yaml" (rc/inline "keycloak/deployment.yaml")
"keycloak/secret.yaml" (rc/inline "keycloak/secret.yaml")
"keycloak/service.yaml" (rc/inline "keycloak/service.yaml")
(throw (js/Error. "Undefined Resource!")))))
(defn-spec generate-ingress cp/map-or-seq? (defn-spec generate-ingress cp/map-or-seq?
[config config?] [config config?]