Launch bb and connect to the nrepl server from your IDE.
bb --nrepl-server
make sure bb tool is available on your PATH, create bb.edn in the project your interested in like below. Copy the tasks you actually need for the project.
{:paths ["src"]
:deps {atomjuice/build-tools {:git/url "[email protected]:atomjuice/build-tools.git"
:git/sha "1217cce7032d65394105f11b7ed9216bcbdf86d3"}}
:tasks
{hooks {:doc "Hook related commands"
:requires ([build-tools.git-hooks :as gh])
:task (apply gh/hooks *command-line-args*)}
fetch-artifact-images
{:doc "Fetch project images"
:requires ([gcp.clean-artifact-registry :as ar])
:task (apply ar/list-artifact-images *command-line-args*)}}}
The cronjob task will read in a cronjobs.edn file with details on how to deploy for a specific deployment.
This will list the installed task in bb.edn
bb tasks
Example cleaning gcp artifact registry
bb fetch-artifact-images clean --image europe-docker.pkg.dev/atomjuice-staging/applications/merchant-api
Using this with cloud build is a bit more complicated as we need gcloud java and bb available, there is a docker file to facilitate this.
Building images for prod and stage projects with these commands
docker build -f Dockerfile-gcloud -t europe-docker.pkg.dev/atomjuice-production/tools/babashka . docker build -f Dockerfile-gcloud -t europe-docker.pkg.dev/atomjuice-staging/tools/babashka .
Push to gcp with these commands.
docker push europe-docker.pkg.dev/atomjuice-production/tools/babashka docker push europe-docker.pkg.dev/atomjuice-staging/tools/babashka
There is a github action here https://github.com/marketplace/actions/babashka-clojure