██████╗ ██████╗ █████╗ ██████╗████████╗██╗ ██████╗ █████╗ ██╗ ██╗ ██╗
██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██║██╔════╝██╔══██╗██║ ██║ ██║
██████╔╝██████╔╝███████║██║ ██║ ██║██║ ███████║██║ ██║ ██║
██╔═══╝ ██╔══██╗██╔══██║██║ ██║ ██║██║ ██╔══██║██║ ██║ ██║
██║ ██║ ██║██║ ██║╚██████╗ ██║ ██║╚██████╗██║ ██║███████╗███████╗██║
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝
TODO: add status badges for https://github.com/Practicalli/{{scm/repo}} workflows and issues
TODO: Provide a meaningful description of the project
Project created with deps-new and the practicalli/service template
Run the service (clojure.main)
clojure -M:run/serviceRun the greet function (clojure.exec), optionally passing a :name key and value as arguments
clojure -X:run/greet :name '"team name"'List all the available project tasks using the make help
makeThis project uses
maketasks to run the Clojure tests, kaocha test runner and package the service into an uberjar. TheMakefileusesclojurecommands and arguments that can be used directly if not usingmake.
Start the REPL with the Practicalli REPL Reloaded aliases to include the custom user namespace (dev/user.clj) which provides additional tools for development (IntegrantREPL, add-libs hotload, find-deps, Portal data inspector)
make replEvaluate (start) expression at the repl prompt to start the service. Several mulog events should be published to the terminal window.
Connect a clojure aware editor and start developing the code, evaluating changes as they are made.
(refresh) will reload any changed namespaces
The local nREPL server port will be printed, along with a help menu showing the REPL Reloaded tools available.
:dev/reloadedalias should be included in the editor command (jack-in) to start a REPL
Using an editor with Clojure LSP (or clj-kondo) integration provides diagnostic feedback on syntax and idomatic code use, as that code is typed into the editor and throughout an entire project.
.lsp/config.edn provides exclusions where diagnostic warnings add no value, e.g. ignore unused public function warnings where those functions are part of the external interface of the project.
Run unit tests of the service using the kaocha test runner
make testIf additional libraries are required to support tests, add them to the
:test/envalias definition indeps.edn
make test-watch will run tests on file save, although changes to template.edn may require cancelling the test watch (Control-c) and restarting. test-watch requires Practicalli Clojure CLI Config :test/watch alias.
Check the code format before pushing commits to a shared repository, using cljstyle to check the Clojure format, MegaLinter to check format of all other files and kaocha test runner to test the Clojure code.
Before running the pre-commit-check
- install cljstyle{target=_blank}
- MegaLinter runs in a Docker container, so ensure Docker is running
make pre-commit-checkRun cljstyle only
make format-checkruns cljstyle and and prints a report if there are errorsmake format-fixupdates all files if there are errors (check the changes made viagit diff)
Run MegaLinter only
make lintruns all configured linters in.github/config/megalinter.yamlmake lint-fixas above and applies fixes
Run Kaocha test runner only
make testruns all unit tests in the project, stopping at first failing testmake test-watchdetect file changes and run all unit tests in the project, stopping at first failing test
Build an uberjar to deploy the service as a jar file
make build-uberjarmake build-configdisplays the tools.build configurationmake build-cleandeletes the build assets (targetdirectory)
make docker-buildmake docker-downshuts down all services started withdocker-buildmake docker-build-clean
Or build and run the service via the multi-stage Dockerfile configuration as part of a CI workflow.
Copyright © 2024 Practicalli