-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbb.edn
More file actions
36 lines (29 loc) · 1.79 KB
/
bb.edn
File metadata and controls
36 lines (29 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{:deps {http-kit/http-kit {:mvn/version "2.8.0"}
cheshire/cheshire {:mvn/version "5.13.0"}}
:pods {org.babashka/go-sqlite3 {:version "0.3.13"}}
:tasks {:requires ([babashka.fs :as fs]
[babashka.process :as p]
[clojure.string :as str])
start {:doc "Start the workshop server"
:task (clojure.core/load-file "workshop.bb")}
dev {:doc "Start with verbose logging"
:task (do (System/setProperty "workshop.verbose" "true")
(clojure.core/load-file "workshop.bb"))}
lint {:doc "Run clj-kondo linter"
:task (do (println "Running clj-kondo...")
(p/shell "nix" "run" "nixpkgs#clj-kondo" "--" "--lint" "workshop.bb" "client.bb"))}
fmt {:doc "Check formatting with cljfmt"
:task (do (println "Checking formatting...")
(p/shell "nix" "run" "nixpkgs#cljfmt" "--" "check" "workshop.bb" "client.bb"))}
test {:doc "Run smoke tests against local server"
:task (do (println "Starting test server...")
(let [server (p/process "bb" "workshop.bb" {:out :inherit})]
(Thread/sleep 2000)
(try
(println "Running tests...")
(p/shell "curl" "-s" "-X" "POST" "http://localhost:4242/ch/test"
"-H" "Content-Type: application/json"
"-d" "{\"from\":\"test\",\"type\":\"test\",\"body\":{}}")
(println "✓ All tests passed")
(finally
(p/destroy-tree server)))))}}}