https://github.com/aemengo/snb
simple, declarative, build automation tool
https://github.com/aemengo/snb
build compile make
Last synced: 9 months ago
JSON representation
simple, declarative, build automation tool
- Host: GitHub
- URL: https://github.com/aemengo/snb
- Owner: aemengo
- License: apache-2.0
- Created: 2018-06-11T02:26:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-24T01:12:08.000Z (over 7 years ago)
- Last Synced: 2025-04-18T09:34:04.662Z (9 months ago)
- Topics: build, compile, make
- Language: Go
- Homepage:
- Size: 4.03 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snb
[](https://travis-ci.org/aemengo/snb)

snb, abbreviation for *"Shake 'N Bake"*, is a flexible build automation tool with caching capabilities and straightfoward rules. To use, simply run the executable in the directory containing a **ShakeAndBakeFile** spec or pass the directory as an argument.
## Installation
Using [Homebrew](https://brew.sh/) (darwin):
```shell
$ brew tap aemengo/snb https://github.com/aemengo/snb
$ brew update
$ brew install snb
```
Using [Go](https://golang.org/) (all platforms):
```shell
$ export PATH="$GOPATH/bin:$PATH"
$ go get -u github.com/aemengo/snb
```
## Spec
```shell
$ cat ShakeAndBakeFile
RUN ./operation.sh ./build-artifacts
RUN echo "success!"
```
An example **ShakeAndBakeFile** looks like above. Steps are declared with `RUN` directive and must be terminated with a completely blank line or the end of the file. Multi-line statements are supported.
## Implementation
Each step is scanned for referenced files and directories. A sha1 checksum is taken after each is executed, for the aforementioned files and directories, and stored in a sqlite database in `.snb/snb.db`. When snb is invoked again, the step definition and checksums of referenced files and directories are compared: opting to skip any steps that completely match.
> A best practice is to document the input and output artifacts of every step that you'd wish snb to track for changes.
### Step Details
* Each step is executed in its own `bash` shell, so declared environment variables and directory changes will not carry over.
* Each step is executed relative to the directory of the ShakeAndBakeFile.
* Each step is executed with all environment variables of the shell that snb is invoked in.
* Each step without any referenced files or directories will not be cached.
## Building
### Prerequisites
* [Golang](https://golang.org/): 1.10+
1. `cd` into the root directory of the project.
2. Compile the snb library.
```shell
$ go build .
```
## Testing
1. Install the [ginkgo](https://github.com/onsi/ginkgo) test runner cli
```shell
$ go get -u github.com/onsi/ginkgo/ginkgo
```
2. Execute tests
```shell
$ ginkgo -r
```
## License
[Apache 2.0](LICENSE).
Copyright (c) 2018 Anthony Emengo