|
1 | 1 | {:min-bb-version "0.4.0" |
2 | 2 | :tasks |
3 | | - {:requires ([babashka.fs :as fs]) |
| 3 | + {:requires ([babashka.fs :as fs] |
| 4 | + [clojure.string :as str]) |
| 5 | + :init (do |
| 6 | + (defn release-tag [& {:keys [dir]}] |
| 7 | + (->> (shell {:out :string |
| 8 | + :dir dir} |
| 9 | + "git tag -l --sort=v:refname") |
| 10 | + :out |
| 11 | + str/split-lines |
| 12 | + (filter (fn [s] |
| 13 | + (re-find (re-pattern "^v\\d+\\.\\d+\\.\\d+$") s))) |
| 14 | + last |
| 15 | + str/trim)) |
| 16 | + (def opts {:extra-env {"DAY8_RELEASE_TAG" (release-tag)}})) |
4 | 17 | clean (let [clean-targets ["node_modules" |
5 | 18 | "run/resources/public/compiled_dev " |
6 | 19 | "run/resources/public/compiled_prod" |
|
9 | 22 | (println "bb clean: deleting" target) |
10 | 23 | (fs/delete-tree target))) |
11 | 24 | install (shell "npm install") |
12 | | - test {:depends [clean install] |
13 | | - :task (do (shell "npx shadow-cljs compile karma-test") |
14 | | - (shell "npx karma start --single-run --reporters junit,dots"))} |
| 25 | + test {:depends [install] |
| 26 | + :task (do (shell opts "npx shadow-cljs compile karma-test") |
| 27 | + (shell opts "npx karma start --single-run --reporters junit,dots"))} |
15 | 28 | jar {:depends [clean] |
16 | | - :task (shell "clojure -T:build jar")} |
| 29 | + :task (shell opts "clojure -T:build jar")} |
17 | 30 | release-clojars {:depends [jar] |
18 | | - :task (shell "clojure -T:build clojars")} |
| 31 | + :task (shell opts "clojure -T:build clojars")} |
19 | 32 | release-demo {:depends [clean install] |
20 | | - :task (shell "npx shadow-cljs release demo")} |
| 33 | + :task (shell opts "npx shadow-cljs release demo")} |
21 | 34 | ci {:depends [install test clean install release-demo]} |
22 | 35 | build-report-ci {:depends [install] |
23 | | - :task (shell "npx shadow-cljs clj-run shadow.cljs.build-report demo" |
| 36 | + :task (shell opts "npx shadow-cljs clj-run shadow.cljs.build-report demo" |
24 | 37 | "target/build-report.html")} |
25 | 38 | watch {:depends [install] |
26 | | - :task (shell "npx shadow-cljs watch demo browser-test karma-test")} |
| 39 | + :task (shell opts "npx shadow-cljs watch demo browser-test karma-test")} |
27 | 40 | watch-demo {:depends [install] |
28 | | - :task (shell "npx shadow-cljs watch demo")} |
| 41 | + :task (shell opts "npx shadow-cljs watch demo")} |
29 | 42 | browser-test {:depends [install] |
30 | | - :task (shell "npx shadow-cljs watch browser-test")} |
| 43 | + :task (shell opts "npx shadow-cljs watch browser-test")} |
31 | 44 | deploy-aws {:depends [ci] |
32 | | - :task (shell "aws s3 sync run/resources/public s3://re-demo/ --acl" |
| 45 | + :task (shell opts "aws s3 sync run/resources/public s3://re-demo/ --acl" |
33 | 46 | "public-read" |
34 | 47 | "--cache-control" |
35 | 48 | "max-age=2592000,public")}}} |
0 commit comments