Merge branch 'c4k_common_upgrade' into 'master'

Upgraded c4k-common

See merge request domaindrivenarchitecture/c4k-nextcloud!3
This commit is contained in:
Michael Jerger 2021-11-12 10:16:22 +00:00
commit 3265b6aaaf
5 changed files with 24 additions and 7 deletions

View file

@ -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.4"]
[org.domaindrivenarchitecture/c4k-common-clj "0.3.2-SNAPSHOT"]]
[org.domaindrivenarchitecture/c4k-common-clj "1.0.0"]]
:target-path "target/%s/"
:source-paths ["src/main/cljc"
"src/main/clj"]

View file

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

View file

@ -21,10 +21,13 @@
::aws-access-key-id ::aws-secret-access-key
::restic-password]))
(defn k8s-objects [config]
(defn-spec k8s-objects any?
[config (s/merge config? auth?)]
(into
[]
(concat [(yaml/to-string (postgres/generate-config :postgres-size :8gb))
(concat [(yaml/to-string (postgres/generate-config {:postgres-size :8gb}))
(yaml/to-string (postgres/generate-secret config))]
(when (contains? config :postgres-data-volume-path)
[(yaml/to-string (postgres/generate-persistent-volume config))])

View file

@ -4,7 +4,7 @@
#?(:cljs [shadow.resource :as rc])
[dda.c4k-common.yaml :as yaml]
[dda.c4k-common.base64 :as b64]
[dda.c4k-common.prefixes :as cp]
[dda.c4k-common.predicate :as cp]
[dda.c4k-common.common :as cm]))
(s/def ::fqdn cp/fqdn-string?)

View file

@ -2,7 +2,9 @@
(:require
#?(:clj [clojure.test :refer [deftest is are testing run-tests]]
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
[dda.c4k-nextcloud.core :as cut]))
[clojure.string :as st]
[dda.c4k-nextcloud.core :as cut]
))
(deftest should-k8s-objects
(is (= 16
@ -38,4 +40,16 @@
:issuer :prod
:aws-access-key-id "aws-id"
:aws-secret-access-key "aws-secret"
:restic-password "restic-pw"})))))
:restic-password "restic-pw"}))))
(is (st/includes?
(get-in (cut/k8s-objects {:fqdn "nextcloud-neu.prod.meissa-gmbh.de"
:postgres-db-user "nextcloud"
:postgres-db-password "nextcloud-db-password"
:nextcloud-admin-user "cloudadmin"
:nextcloud-admin-password "cloudpassword"
:issuer :prod
:aws-access-key-id "aws-id"
:aws-secret-access-key "aws-secret"
:restic-password "restic-pw"})
[0])
"max_connections = 700")))