Skip to content

Commit

Permalink
add babashka tasks for easy development
Browse files Browse the repository at this point in the history
  • Loading branch information
WarFox committed Jul 3, 2023
1 parent b5b593c commit b957270
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
25 changes: 19 additions & 6 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -131,26 +131,39 @@ FIXME: listing of options this app accepts.

** Run

#+begin_src
clj -M:dev:run run -d datasource.edn -t tables/employees.edn
#+begin_src shell
clj -M:dev:run run -d datasource.edn -t tables/employees.edn
#+end_src

#+begin_src shell
bb run-example
#+end_src

* Development

** Run development mode with babashka

#+begin_src shell
bb dev
#+end_src

** Test database

Run =docker compose up= to have postgress running

** Run migraion

#+begin_src
$ clj -X:dev:migrate
#+begin_src shell
bb migrate
#+end_src

** Run test

#+begin_src
$ clj -M:dev:test
#+begin_src shell
clj -M:dev:test
clj -M:dev:test --watch
bb test
bb test:watch
#+end_src

#+begin_src
Expand Down
15 changes: 15 additions & 0 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{:tasks {;; Used only in local development.
dev {:doc "Runs app in dev mode. Compiles cljs, less and runs JVM app in parallel."
:task (run '-dev {:parallel true})}
-dev {:depends [dev:docker test:watch]}
dev:docker {:doc "Start docker with database"
:task (shell "docker compose up")}

run-example {:dock "Run example"
:task (clojure "-M:dev:run run -d examples/postgres.edn -t examples/tables/employees.edn")}

test (clojure "-M:dev:test")
test:watch (clojure "-M:dev:test --watch")

migrate (clojure "-X:dev:migrate")
uberjar (clojure "-X:uberjar")}}

0 comments on commit b957270

Please sign in to comment.