Compare commits
3 commits
7ff6f20fce
...
74beafdcfe
Author | SHA1 | Date | |
---|---|---|---|
74beafdcfe | |||
fd8b1facb8 | |||
9f2ee663bd |
4 changed files with 35 additions and 30 deletions
24
build.py
24
build.py
|
@ -100,6 +100,12 @@ def package_frontend(project):
|
|||
|
||||
@task
|
||||
def package_uberjar(project):
|
||||
run("mkdir -p target/uberjar", shell=True, check=True)
|
||||
run(
|
||||
"lein uberjar",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
run(
|
||||
"sha256sum target/uberjar/c4k-keycloak-standalone.jar > target/uberjar/" + project.name + "-standalone.jar.sha256",
|
||||
shell=True,
|
||||
|
@ -126,13 +132,10 @@ def package_native(project):
|
|||
"--no-server " +
|
||||
"--no-fallback " +
|
||||
"--features=clj_easy.graal_build_time.InitClojureClasses " +
|
||||
"-jar target/uberjar/" + project.name + "-standalone.jar " +
|
||||
"-march=compatibility " +
|
||||
"-H:+UnlockExperimentalVMOptions " +
|
||||
f"-jar target/uberjar/{project.name}-standalone.jar " +
|
||||
"-H:IncludeResources=.*.yaml " +
|
||||
"-H:IncludeResources=logback.xml " +
|
||||
"-H:Log=registerResource:verbose " +
|
||||
"-H:Name=target/graalvm/" + project.name + "",
|
||||
f"-H:Name=target/graalvm/{project.name}",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
|
@ -150,11 +153,7 @@ def package_native(project):
|
|||
|
||||
@task
|
||||
def inst(project):
|
||||
run(
|
||||
"lein uberjar",
|
||||
shell=True,
|
||||
check=True,
|
||||
)
|
||||
package_uberjar(project)
|
||||
package_native(project)
|
||||
run(
|
||||
"sudo install -m=755 target/uberjar/" + project.name + "-standalone.jar /usr/local/bin/" + project.name + "-standalone.jar",
|
||||
|
@ -175,11 +174,6 @@ def upload_clj(project):
|
|||
|
||||
@task
|
||||
def lint(project):
|
||||
#run(
|
||||
# "lein eastwood",
|
||||
# shell=True,
|
||||
# check=True,
|
||||
#)
|
||||
run(
|
||||
"lein ancient check",
|
||||
shell=True,
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
:url "https://domaindrivenarchitecture.org"
|
||||
:license {:name "Apache License, Version 2.0"
|
||||
:url "https://www.apache.org/licenses/LICENSE-2.0.html"}
|
||||
:dependencies [[org.clojure/clojure "1.11.3"]
|
||||
:dependencies [[org.clojure/clojure "1.11.4"]
|
||||
[org.clojure/tools.reader "1.4.2"]
|
||||
[org.domaindrivenarchitecture/c4k-common-clj "6.4.1"]]
|
||||
[org.domaindrivenarchitecture/c4k-common-clj "8.0.0"]]
|
||||
:target-path "target/%s/"
|
||||
:source-paths ["src/main/cljc"
|
||||
"src/main/clj"]
|
||||
|
@ -24,7 +24,7 @@
|
|||
:dependencies [[org.clojure/tools.cli "1.1.230"]
|
||||
[ch.qos.logback/logback-classic "1.5.6"
|
||||
:exclusions [com.sun.mail/javax.mail]]
|
||||
[org.slf4j/jcl-over-slf4j "2.0.13"]
|
||||
[org.slf4j/jcl-over-slf4j "2.0.14"]
|
||||
[com.github.clj-easy/graal-build-time "1.0.5"]]}}
|
||||
:release-tasks [["test"]
|
||||
["vcs" "assert-committed"]
|
||||
|
|
|
@ -7,10 +7,11 @@
|
|||
(set! *warn-on-reflection* true)
|
||||
|
||||
(defn -main [& cmd-args]
|
||||
(uberjar/main-common
|
||||
(uberjar/main-cm
|
||||
"c4k-keycloak"
|
||||
core/config?
|
||||
core/auth?
|
||||
core/config-defaults
|
||||
core/k8s-objects
|
||||
core/config-objects
|
||||
core/auth-objects
|
||||
cmd-args))
|
||||
|
|
|
@ -30,18 +30,28 @@
|
|||
::postgres/postgres-db-user ::postgres/postgres-db-password]
|
||||
:opt-un [::mon/mon-auth]))
|
||||
|
||||
(defn-spec k8s-objects cp/map-or-seq?
|
||||
(defn-spec config-objects cp/map-or-seq?
|
||||
[config config?]
|
||||
(map yaml/to-string
|
||||
(filter
|
||||
#(not (nil? %))
|
||||
(cm/concat-vec
|
||||
(ns/generate config)
|
||||
(postgres/generate-config config)
|
||||
[(kc/generate-service config)
|
||||
(kc/generate-deployment config)]
|
||||
(kc/generate-ingress config)
|
||||
(when (contains? config :mon-cfg)
|
||||
(mon/generate-config))))))
|
||||
|
||||
(defn-spec auth-objects cp/map-or-seq?
|
||||
[config config?
|
||||
auth auth?]
|
||||
(map yaml/to-string
|
||||
(filter
|
||||
#(not (nil? %))
|
||||
(cm/concat-vec
|
||||
(ns/generate config)
|
||||
(postgres/generate config auth)
|
||||
[(kc/generate-secret config auth)
|
||||
(kc/generate-service config)
|
||||
(kc/generate-deployment config)]
|
||||
(kc/generate-ingress config)
|
||||
(when (:contains? config :mon-cfg)
|
||||
(mon/generate (:mon-cfg config) (:mon-auth auth)))))))
|
||||
(postgres/generate-auth config auth)
|
||||
[(kc/generate-secret config auth)]
|
||||
(when (and (contains? auth :mon-auth) (contains? config :mon-cfg))
|
||||
(mon/generate-auth (:mon-config config) (:mon-auth auth)))))))
|
||||
|
|
Loading…
Reference in a new issue