Added Tests: web-service, etherpad-service, excalidraw-backend-service, excalidraw-deployment, meapp-development, meapp-fullstack-service
This commit is contained in:
parent
0e47be31c6
commit
8f714c3bdd
8 changed files with 109 additions and 12 deletions
|
@ -83,17 +83,33 @@
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/jvb-service.yaml"))
|
(yaml/from-string (yaml/load-resource "jitsi/jvb-service.yaml"))
|
||||||
(cm/replace-all-matching "NAMESPACE" namespace))))
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-web-service cp/map-or-seq? []
|
(defn-spec generate-web-service cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/web-service.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/web-service.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-etherpad-service cp/map-or-seq? []
|
(defn-spec generate-etherpad-service cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/etherpad-service.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/etherpad-service.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-excalidraw-backend-service cp/map-or-seq? []
|
(defn-spec generate-excalidraw-backend-service cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/excalidraw-backend-service.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/excalidraw-backend-service.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-meapp-fullstack-service cp/map-or-seq? []
|
(defn-spec generate-meapp-fullstack-service cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/meapp-fullstack-service.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/meapp-fullstack-service.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-deployment cp/map-or-seq?
|
(defn-spec generate-deployment cp/map-or-seq?
|
||||||
[config config?]
|
[config config?]
|
||||||
|
@ -108,8 +124,16 @@
|
||||||
(cm/replace-all-matching "REPLACE_EXCALIDRAW_BACKEND_URL"
|
(cm/replace-all-matching "REPLACE_EXCALIDRAW_BACKEND_URL"
|
||||||
(str "https://excalidraw-backend." fqdn)))))
|
(str "https://excalidraw-backend." fqdn)))))
|
||||||
|
|
||||||
(defn-spec generate-excalidraw-deployment cp/map-or-seq? []
|
(defn-spec generate-excalidraw-deployment cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/excalidraw-deployment.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [fqdn namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/excalidraw-deployment.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
||||||
(defn-spec generate-meapp-deployment cp/map-or-seq? []
|
(defn-spec generate-meapp-deployment cp/map-or-seq?
|
||||||
(yaml/load-as-edn "jitsi/meapp-deployment.yaml"))
|
[config config?]
|
||||||
|
(let [{:keys [fqdn namespace]} config]
|
||||||
|
(->
|
||||||
|
(yaml/load-as-edn "jitsi/meapp-deployment.yaml")
|
||||||
|
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
service: etherpad
|
service: etherpad
|
||||||
name: etherpad
|
name: etherpad
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: etherpad
|
- name: etherpad
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
service: excalidraw-backend
|
service: excalidraw-backend
|
||||||
name: excalidraw-backend
|
name: excalidraw-backend
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: excalidraw-backend
|
- name: excalidraw-backend
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: excalidraw-backend
|
app: excalidraw-backend
|
||||||
name: excalidraw-backend
|
name: excalidraw-backend
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: meapp-fullstack
|
app: meapp-fullstack
|
||||||
name: meapp-fullstack
|
name: meapp-fullstack
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
service: meapp-fullstack
|
service: meapp-fullstack
|
||||||
name: meapp-fullstack
|
name: meapp-fullstack
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: "http"
|
- name: "http"
|
||||||
|
|
|
@ -4,6 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
service: web
|
service: web
|
||||||
name: web
|
name: web
|
||||||
|
namespace: NAMESPACE
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: "http"
|
- name: "http"
|
||||||
|
|
|
@ -168,3 +168,70 @@
|
||||||
(cut/generate-jvb-service
|
(cut/generate-jvb-service
|
||||||
{:fqdn "xy.xy.xy"
|
{:fqdn "xy.xy.xy"
|
||||||
:namespace "jitsi"}))))
|
:namespace "jitsi"}))))
|
||||||
|
|
||||||
|
(deftest should-generate-web-service
|
||||||
|
(is (= {:apiVersion "v1",
|
||||||
|
:kind "Service",
|
||||||
|
:metadata {:labels {:service "web"}, :name "web", :namespace "jitsi"},
|
||||||
|
:spec
|
||||||
|
{:ports
|
||||||
|
[{:name "http", :port 80, :targetPort 80}
|
||||||
|
{:name "https", :port 443, :targetPort 443}],
|
||||||
|
:selector {:app "jitsi"}}}
|
||||||
|
(cut/generate-web-service
|
||||||
|
{:fqdn "xy.xy.xy"
|
||||||
|
:namespace "jitsi"}))))
|
||||||
|
|
||||||
|
(deftest should-generate-etherpad-service
|
||||||
|
(is (= {:apiVersion "v1",
|
||||||
|
:kind "Service",
|
||||||
|
:metadata
|
||||||
|
{:labels {:service "etherpad"}, :name "etherpad", :namespace "jitsi"},
|
||||||
|
:spec
|
||||||
|
{:ports [{:name "etherpad", :port 9001, :targetPort 9001}],
|
||||||
|
:selector {:app "jitsi"}}}
|
||||||
|
(cut/generate-etherpad-service
|
||||||
|
{:fqdn "xy.xy.xy"
|
||||||
|
:namespace "jitsi"}))))
|
||||||
|
|
||||||
|
(deftest should-generate-excalidraw-backend-service
|
||||||
|
(is (= {:apiVersion "v1",
|
||||||
|
:kind "Service",
|
||||||
|
:metadata
|
||||||
|
{:labels {:service "excalidraw-backend"},
|
||||||
|
:name "excalidraw-backend",
|
||||||
|
:namespace "jitsi"},
|
||||||
|
:spec
|
||||||
|
{:ports [{:name "excalidraw-backend", :port 3002, :targetPort 80}],
|
||||||
|
:selector {:app "excalidraw-backend"}}}
|
||||||
|
(cut/generate-excalidraw-backend-service
|
||||||
|
{:fqdn "xy.xy.xy"
|
||||||
|
:namespace "jitsi"}))))
|
||||||
|
|
||||||
|
(deftest should-generate-meapp-fullstack-service
|
||||||
|
(is (= {:apiVersion "v1",
|
||||||
|
:kind "Service",
|
||||||
|
:metadata
|
||||||
|
{:labels {:service "excalidraw-backend"},
|
||||||
|
:name "excalidraw-backend",
|
||||||
|
:namespace "jitsi"},
|
||||||
|
:spec
|
||||||
|
{:ports [{:name "excalidraw-backend", :port 3002, :targetPort 80}],
|
||||||
|
:selector {:app "excalidraw-backend"}}}
|
||||||
|
(cut/generate-excalidraw-backend-service
|
||||||
|
{:fqdn "xy.xy.xy"
|
||||||
|
:namespace "jitsi"}))))
|
||||||
|
|
||||||
|
(deftest should-generate-excalidraw-deployment
|
||||||
|
(is (= {:apiVersion "v1",
|
||||||
|
:kind "Service",
|
||||||
|
:metadata
|
||||||
|
{:labels {:service "excalidraw-backend"},
|
||||||
|
:name "excalidraw-backend",
|
||||||
|
:namespace "jitsi"},
|
||||||
|
:spec
|
||||||
|
{:ports [{:name "excalidraw-backend", :port 3002, :targetPort 80}],
|
||||||
|
:selector {:app "excalidraw-backend"}}}
|
||||||
|
(cut/generate-excalidraw-backend-service
|
||||||
|
{:fqdn "xy.xy.xy"
|
||||||
|
:namespace "jitsi"}))))
|
Loading…
Reference in a new issue