|
9 | 9 | [bb.tasks :as t]
|
10 | 10 | [clojure.string :as str]]
|
11 | 11 |
|
12 |
| - run-branch |
13 |
| - {:requires [[bb.dl-and-run :as dl]] |
14 |
| - :doc "Download and run a jar for a branch, on a port. Respects MB_DB_CONNECTION_URI." |
15 |
| - :examples [["bb run-branch --branch master --port 4445" "Run master branch on port 4445"] |
16 |
| - ["bb run-branch" "Pick branch and port, and run branch on port"] |
17 |
| - ["bb run-branch -p 9939 -s 9938" "Pick a branch, and run it on port 4445 with a socket repl on 9938"]] |
18 |
| - :task |
19 |
| - (do (dl/check-gh-token!) |
20 |
| - (dl/download-and-run-latest-jar! |
21 |
| - (let [list-branches (delay ;; choices can be a delay -- we dont want to grab theese unless we need them. |
22 |
| - (t/list-branches |
23 |
| - (t/env "MB_DIR" (fn [] |
24 |
| - (println (c/red "Please put the path of your metabase repository into the MB_DIR env variable like so:")) |
25 |
| - (println (c/white "export MB_DIR=path/to/metabase")) |
26 |
| - (System/exit 1)))))] |
27 |
| - (cli/menu! (current-task) |
28 |
| - {:id :branch :msg "What branch should we run?" :short "-b" :long "--branch BRANCH" :choices list-branches :choices-doc "list of branches" :prompt :select} |
29 |
| - {:id :port :msg "What port should we run it on?" :short "-p" :long "--port PORT" :prompt :number :default 3337} |
30 |
| - {:id :socket-repl :msg "What port shall we open a socket repl on?" :short "-s" :long "--socket-repl SOCKETPORT"}))))} |
31 |
| - |
32 | 12 | metabuild
|
33 | 13 | {:doc "Starts metabase locally in dev mode. Set FORCE_MB_DB_CONNECTION_URI to override connection string building"
|
34 | 14 | :requires [[bb.meta :as meta]]
|
|
68 | 48 | :choices-doc "a list of clojure test namespaces"})))}
|
69 | 49 |
|
70 | 50 | watch-ci
|
71 |
| - {:requires [[bb.dl-and-run :as dl] |
72 |
| - [bb.watch-ci :as watch-ci]] |
73 |
| - :doc "Watch the CI status for a branch until it passes." |
74 |
| - :examples [["bb watch-ci --branch current" "Check currently checked out branch in MB_DIR repo"]] |
75 |
| - :task |
76 |
| - (do (dl/check-gh-token!) |
77 |
| - (let [{:keys [branch]} (cli/menu! (current-task) |
78 |
| - {:id :branch |
79 |
| - :msg "What branch should we check?" |
80 |
| - :short "-b" |
81 |
| - :long "--branch BRANCH" |
82 |
| - :choices (delay (t/list-branches (t/mb-dir))) |
83 |
| - :choices-doc "list of branches" |
84 |
| - :prompt :select}) |
85 |
| - branch (if (= "current" branch) |
86 |
| - (let [current (t/current-branch)] |
87 |
| - (do (println (c/green (c/bold "Using current branch: " (t/current-branch)))) |
88 |
| - current)) |
89 |
| - branch)] |
90 |
| - (watch-ci/branch branch)))} |
| 51 | + {:doc "Prints the command to watch your CI build for a specific branch." |
| 52 | + :task (println |
| 53 | + (str/join "\n" ["To watch your branch, cd to metabase, switch to your branch, and run:" |
| 54 | + "" |
| 55 | + "gh pr checks --watch --required && say done" |
| 56 | + ""]))} |
| 57 | + |
| 58 | + github-bookmarklet |
| 59 | + {:doc "Print info about Tim's Amazing Github Bookmarklet." |
| 60 | + :task (println |
| 61 | + (str/join "\n" |
| 62 | + ["Save this as a bookmarklet, and click it on a github page to remove passing tests:" |
| 63 | + "" |
| 64 | + "javascript:%20document.querySelectorAll(%22.merge-status-item%20.octicon-check,.octicon-skip%22).forEach((el)%20=%3E%20el.parentElement.parentElement.remove())" |
| 65 | + ""]))} |
91 | 66 |
|
92 | 67 | install-autotab {:doc "Prints shell code to autocomplete tasks using bb.
|
93 | 68 | Note: for fish shell please make sure ~/.config/fish/completions exists."
|
|
0 commit comments