Skip to content

step

BigConfig Step provides a Babashka-powered DSL for defining and executing infrastructure workflows directly from the CLI.

bb <step|cmd>+ -- <module> <profile> [global-args]
  • Steps: Predefined functions built into the DSL (e.g., render, lock).
  • Commands: Any argument not recognized as a Step is treated as a shell command.
    • The : character is automatically replaced with a space.
    • Example: tofu:plan becomes tofu plan.
StepDescription
renderGenerate the configuration files.
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.
execExecutes commands provided in the global-args.

The DSL allows you to chain commands or pass arguments globally.

1. Using exec vs. Direct Mapping

These commands are functionally identical:

Terminal window
# Using the exec step with global-args
bb exec -- alpha prod ansible-playbook main.yml
# Using direct command mapping
bb ansible-playbook:main.yml -- alpha prod

2. Handling Arguments

You can pass arguments globally after the -- separator, or inline using the colon syntax:

Terminal window
# Global arguments (applied to all steps)
bb tofu:apply tofu:destroy -- alpha prod -auto-approve
# Inline arguments (specific to each command)
bb tofu:apply:-auto-approve tofu:destroy:-auto-approve -- alpha prod

3. Quick Reference: Command Syntax

  • tofu:init -> tofu init
  • tofu:plan -> tofu plan
  • ansible-playbook:main.yml -> ansible-playbook main.yml

By using an alias, you can make BigConfig invisible to your daily workflow, wrapping your standard tools in a safety-first pipeline (rendering, locking, and syncing) automatically.

Terminal window
# Example: Wrapping Tofu with a full safety lifecycle
alias tofu="bb render git-check lock exec git-push unlock-any -- alpha prod tofu"
(parse-module-and-profile s)

Function.

Given a BigConfig DSL, it returns module and profile

Source

(print-step-fn step opts)

Function.

Print all steps of the workflow.

Source

(run-steps s)
(run-steps s opts)
(run-steps s opts step-fns)
(run-steps opts step-fns steps cmds module profile)

Function.

A function that takes a BigConfig DSL and an opts map. It run a dynamic workflow based on the steps defined in the DSL.

Source