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]Core Concepts
Section titled “Core Concepts”- 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:planbecomestofu plan.
- The
Available Steps
Section titled “Available Steps”| Step | Description |
|---|---|
| render | Generate the configuration files. |
| git-check | Verifies the working directory is clean and synced with origin. |
| git-push | Pushes local commits to the remote repository. |
| lock | Acquires an execution lock. |
| unlock-any | Force-releases the lock, regardless of the current owner. |
| exec | Executes commands provided in the global-args. |
Command Mapping Examples
Section titled “Command Mapping Examples”The DSL allows you to chain commands or pass arguments globally.
1. Using exec vs. Direct Mapping
These commands are functionally identical:
# Using the exec step with global-argsbb exec -- alpha prod ansible-playbook main.yml
# Using direct command mappingbb ansible-playbook:main.yml -- alpha prod2. Handling Arguments
You can pass arguments globally after the -- separator, or inline using the
colon syntax:
# 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 prod3. Quick Reference: Command Syntax
tofu:init->tofu inittofu:plan->tofu planansible-playbook:main.yml->ansible-playbook main.yml
Zero-cost workflow
Section titled “Zero-cost workflow”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.
# Example: Wrapping Tofu with a full safety lifecyclealias 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
(print-step-fn step opts)Function.
Print all steps of the workflow.
(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.