diff --git a/build.py b/build.py index 72135c6..8a68495 100644 --- a/build.py +++ b/build.py @@ -38,6 +38,12 @@ def initialize(project): build.initialize_build_dir() +@task +def test(project): + test_clj(project) + test_cljs(project) + test_schema(project) + @task def test_clj(project): run("lein test", shell=True, check=True) diff --git a/src/main/cljc/dda/c4k_shynet/core.cljc b/src/main/cljc/dda/c4k_shynet/core.cljc index 085ac1e..100fd33 100644 --- a/src/main/cljc/dda/c4k_shynet/core.cljc +++ b/src/main/cljc/dda/c4k_shynet/core.cljc @@ -4,6 +4,7 @@ [clojure.spec.alpha :as s] #?(:clj [orchestra.core :refer [defn-spec]] :cljs [orchestra.core :refer-macros [defn-spec]]) + [dda.c4k-common.common :as cm] [dda.c4k-common.yaml :as yaml] [dda.c4k-common.postgres :as postgres] [dda.c4k-common.monitoring :as mon] @@ -26,22 +27,25 @@ (defn config-objects [config] (let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)] (map yaml/to-string - [(postgres/generate-config {:postgres-size :2gb :db-name "shynet"}) - (when (contains? config :postgres-data-volume-path) - (postgres/generate-persistent-volume (select-keys config [:postgres-data-volume-path :pv-storage-size-gb]))) - (postgres/generate-pvc {:pv-storage-size-gb 20 - :pvc-storage-class-name storage-class}) - (postgres/generate-deployment {:postgres-image "postgres:14" - :postgres-size :2gb}) - (postgres/generate-service config) - (shynet/generate-webserver-deployment) - (shynet/generate-celeryworker-deployment) - (shynet/generate-ingress-and-cert config) - (shynet/generate-service-redis) - (shynet/generate-service-webserver) - (shynet/generate-statefulset) - (when (:contains? config :mon-cfg) - (mon/generate (:mon-cfg config) (:mon-auth config)))]))) + (filter + #(not (nil? %)) + (cm/concat-vec + [(postgres/generate-config {:postgres-size :2gb :db-name "shynet"}) + (when (contains? config :postgres-data-volume-path) + (postgres/generate-persistent-volume (select-keys config [:postgres-data-volume-path :pv-storage-size-gb]))) + (postgres/generate-pvc {:pv-storage-size-gb 20 + :pvc-storage-class-name storage-class}) + (postgres/generate-deployment {:postgres-image "postgres:14" + :postgres-size :2gb}) + (postgres/generate-service config) + (shynet/generate-webserver-deployment) + (shynet/generate-celeryworker-deployment) + (shynet/generate-service-redis) + (shynet/generate-service-webserver) + (shynet/generate-statefulset)] + (shynet/generate-ingress-and-cert config) + (when (:contains? config :mon-cfg) + (mon/generate (:mon-cfg config) (:mon-auth config)))))))) (defn auth-objects [config] (map yaml/to-string