bob
bob copied to clipboard
Bob is a high-level build tool for multi-language projects.
Write Once, Build Once, Anywhere
A build system for microservices
Bob is a high-level build system that isolates pipelines from the host system by executing them in a sandboxed shell to run them anywhere - Nix Inside™.
Why is this useful?
- Get rid of "Works on My Machine".
- No more building in Docker.
- Easily jump between different versions of a programming language.
Getting Started
Documentation is available at bob.build
Install
If you wanna go wild and have Go 1.17 or later installed, the short version is:
git clone https://github.com/benchkram/bob
cd bob
go install
For shell autocompletion (bash and zsh supported) add source <(bob completion)
to your .bashrc
/.zshrc
.
How it works
Bobs generates its internal build graph from tasks described in a bob.yaml
file (usually refered to as "Bobfile").
Each build step is executed in a sandbox shell only using the given dependecies required from the nix package manager.
The basic components of a build task are:
- input: Whenever an input changes, the task's commands need to be re-executed.
- cmd: Commands to be executed
- target: Files, directories or docker images created during execution of cmd
- dependencies Dependencies managed by the Nix package manager
Example of a bob.yaml
file:
build:
build:
input: "*"
cmd: go build -o ./app
target: ./app
dependencies: [ git, go_1_18 ]
Multiline sh
and bash
commands are entirely possible, powered by mvdan/sh.