Skip to content

Intro

A BigConfig Package ( announcement ) is a standard Clojure project. The core logic of a package is a function authored via the BigConfig Workflow .

Your package is a dependency within your bb.edn and it is mapped to a Babashka task.

1. Register the Task: Add the package to your :deps and define the task in bb.edn:

{:deps {io.github.amiorin/alice {:git/sha "9c214edce47419297e6bd8212a63bb0ab93bcf86"}}
:tasks
{:requires ([io.github.amiorin.alice.package :as package])
alice {:doc "bb alice create"
:task (package/alice* *command-line-args*)}}}

2. Execute via CLI: Standardize your lifecycle commands. Note that we use create rather than install to reflect that infrastructure is being actively provisioned as part of the delivery.

Terminal window
# Provision the infrastructure and software
bb alice create
# Tear down the resources
bb alice delete

Note: Because BigConfig leverages Babashka, startup times are near-instant, making it ideal for CI/CD pipelines and developer inner-loops alike.

Clone the repo and change the dependency from remote to local. The bb.edn of the repo is also a good start.

{:deps {io.github.amiorin/alice {:local/root "../path/to/cloned/repo"}
:tasks
{:requires ([io.github.amiorin.alice.package :as package])
alice {:doc "bb alice create"
:task (package/alice* *command-line-args*)}}}
StepDescription
createCreate the delivery
deleteDelete the delivery

You can use these client side steps to achieve the same thing you have with Atlantis for Terraform.

StepDescription
git-checkVerifies the working directory is clean and synced with origin.
git-pushPushes local commits to the remote repository.
lockAcquires an execution lock.
unlock-anyForce-releases the lock, regardless of the current owner.

The user can pass his options to the package

{:deps {io.github.amiorin/alice {:git/sha "9c214edce47419297e6bd8212a63bb0ab93bcf86"}}
:tasks
{:requires ([io.github.amiorin.alice.package :as package])
alice {:doc "bb alice create"
:task (package/alice* *command-line-args* {:big-config.render/profile "prod"})}}}

Note: bb.edn doesn’t support the :: notation like Clojure files.

If you need to override the step-fns or generate options dynamically, you can override the <workflow>* function itself.

(ns io.github.new-user.alice.package
(:require
[big-config :as bc]
[big-config.render :as render]
[big-config.workflow :as workflow]
[io.github.amiorin.alice.package :as p]))
(defn alice*
[args & [opts]]
(let [profile "default"
step-fns [(fn [f step opts] (f step opts))]
opts (merge (workflow/parse-args args)
{::bc/env :shell
::render/profile profile
::workflow/prefix (format ".dist/%s" profile)}
opts)]
(p/alice step-fns opts)))
{:deps {io.github.new-user.alice {:local/root "."}}
:tasks
{:requires ([io.github.new-user.alice.package :as package])
;; Provision my version of Alice
alice (package/alice* *command-line-args*)}}