github.com/benchkram/bob@v0.0.0-20240314204020-b7a57f2f9be9/README.md (about) 1 <p align="center"> 2 <img width="300" src="https://bob.build/docs/img/logo.svg" /> 3 </p> 4 <p align="center"> 5 Write Once, Build Once, Anywhere 6 </p> 7 8 --- 9 10 <p> 11 <a href="https://github.com/benchkram/bob/releases"> 12 <img src="https://img.shields.io/github/release/benchkram/bob.svg" alt="Latest Release"> 13 </a> 14 <a href="https://pkg.go.dev/github.com/benchkram/bob?tab=doc"> 15 <img src="https://godoc.org/github.com/golang/gddo?status.svg" alt="GoDoc"> 16 </a> 17 <a href="https://github.com/benchkram/bob/actions"> 18 <img src="https://github.com/benchkram/bob/actions/workflows/main.yml/badge.svg" alt="Build Status"> 19 </a> 20 </p> 21 22 Bob is a high-level build tool for multi-language projects. 23 24 Use it to build codebases organized in multiple repositories or in a monorepo. 25 26 When to consider using Bob? 27 28 - You want a pipeline which runs locally and on CI. 29 - You want remote caching and never having to do the same build twice. 30 - You want to get rid of "Works on My Machine". 31 - You like Bazel and its features but think it's too complex. 32 - You want a build system which keeps frontend tooling functional. 33 34 # Getting Started 35 36 [Docs](https://bob.build/docs/) | [Install](https://bob.build/docs/getting-started/installation/) 37 38 ## Installing From Source 39 40 If you want to go wild, and have Go 1.17 or later installed, the short version is: 41 42 ```bash 43 git clone https://github.com/benchkram/bob 44 cd bob 45 go install 46 ``` 47 48 For shell autocompletion (bash and zsh supported) add `source <(bob completion)` to your `.bashrc`/`.zshrc`. 49 50 # How it works 51 52 Bob generates its internal build graph from tasks described in a `bob.yaml` file (usually referred to as "Bobfile"). 53 Each build step is executed in a sandboxed shell only using the given dependencies required from the nix package manager. 54 55 The basic components of a build task are: 56 57 - **input**: Whenever an input changes, the task's commands need to be re-executed. 58 - **cmd**: Commands to be executed 59 - **target**: Files, directories or docker images created during execution of _cmd_ 60 - **dependencies** Dependencies managed by the Nix package manager 61 62 Example of a `bob.yaml` file: 63 64 ```yaml 65 nixpkgs: https://github.com/NixOS/nixpkgs/archive/nixos-23.11.tar.gz 66 build: 67 build: 68 input: "*" 69 cmd: go build -o ./app 70 target: ./app 71 dependencies: [go] 72 ``` 73 74 Multiline `sh` and `bash` commands are entirely possible, powered by [mvdan/sh](https://github.com/mvdan/sh). 75 76 # Comparisons 77 78 - [Dagger vs. bob](https://medium.com/benchkram/dagger-vs-bob-2e917cd185d3) 79 - [Bazel vs. bob](https://bob.build/blog/vs-bazel) 80 - [Mage vs. bob](https://medium.com/benchkram/build-system-comparison-mage-vs-bob-aaf4665e3d5c)