forked from clj-commons/etaoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
82 lines (80 loc) · 4.48 KB
/
bb.edn
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{:min-bb-version "0.8.2"
:paths ["script"]
:deps {doric/doric {:mvn/version "0.9.0"}
lread/status-line {:git/url "https://github.com/lread/status-line.git"
:sha "cf44c15f30ea3867227fa61ceb823e5e942c707f"}
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}}
:tasks
{;; setup
:requires ([babashka.classpath :as cp]
[babashka.fs :as fs]
[clojure.string :as string]
[helper.shell :as shell]
[lread.status-line :as status])
:enter (let [{:keys [name]} (current-task)]
(when-not (string/starts-with? name "-")
(status/line :head "TASK %s %s" name (string/join " " *command-line-args*))))
:leave (let [{:keys [name]} (current-task)]
(when-not (string/starts-with? name "-")
(status/line :detail "\nTASK %s done." name)))
;; commands
dev:jvm {:doc "start a Clojure nrepl server/prompt"
:task (shell/command "clj" "-M:test:repl/cider")}
dev:bb {:doc "start a Babashka nrepl server"
;; repeat :test paths from deps.edn
:extra-paths ["test" "env/test/resources"]
:extra-deps {;; inherit base deps from deps.edn
etaoin/etaoin {:local/root "."}
;; repeat necessary :test deps from deps.edn
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (do (babashka.nrepl.server/start-server!)
(deref (promise)))}
test:jvm {:doc "Runs tests under JVM Clojure [--help]"
:task test/test-jvm}
-test:bb {:doc "bb test runner, invoked within script/test.clj"
:requires ([taoensso.timbre :as timbre])
;; repeat :test paths from deps.edn
:extra-paths ["test" "env/test/resources"]
:extra-deps {;; inherit base deps from deps.edn
etaoin/etaoin ({:local/root "."})
;; repeat necessary :test deps from deps.edn
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (do
;; timbre default logging level is debug, which generates a lot of http logging noise
(timbre/set-level! :info)
(exec 'cognitect.test-runner.api/test))
:org.babashka/cli {:coerce {:nses [:symbol]
:patterns [:string]
:vars [:symbol]}}}
test:bb {:doc "Runs tests under Babashka [--help]"
:task test/test-bb}
test-doc {:doc "test code blocks in user guide"
:task test-doc/-main}
test-matrix {:doc "Returns a test matrix for CI [--help]"
:task test-matrix/-main}
drivers {:doc "[list|kill] any running WebDrivers"
:task drivers/-main}
lint {:doc "[--rebuild] lint source code"
:task lint/-main}
cljdoc-preview {:doc "preview what docs will look like on cljdoc, use --help for args"
:task cljdoc-preview/-main}
tools-versions {:doc "report on tools versions"
:task tools-versions/-main}
download-deps {:doc "download all deps (useful for CI prep)"
:task download-deps/-main}
outdated {:doc "report on outdated dependencies"
:task (shell/clojure {:continue true} "-M:outdated")}
docker-build {:doc "build etaoin docker image"
:task (shell/command "docker build --no-cache -t etaoin:latest .")}
-docker-install {:doc "helper to setup docker image"
:task docker-install/-main}
docker-run {:doc "run etaoin docker image (specify no commmands for interactive)"
:task (apply shell/command {:continue true}
"docker run -it --rm -v"
(cond-> [(str (fs/cwd) ":/etaoin")
"-w" "/etaoin"]
(not (seq *command-line-args*)) (conj "--entrypoint" "/bin/bash")
:always (conj "etaoin:latest")
:always (concat *command-line-args*)))}
ci-release {:doc "release tasks, use --help for args"
:task ci-release/-main }}}