Development
Build instructions
Prerequisites
- go 1.19 or above
- goreleaser (optional)
- golangci-lint (optional)
Building
# Build sake for your platform target
make build
# Build sake binaries and archives for all platforms using goreleaser
make build-all
# Generate Manpage
make gen-man
Developing
# Format code
make gofmt
# Manage dependencies (download/remove unused)
make tidy
# Lint code
make lint
# Standing in examples directory you can run the following to debug faster
go run ../main.go run ping -a
Releasing
The following workflow is used for releasing a new sake
version:
- Create pull request with changes
- Verify build works (especially windows build)
make build
make build-all
- Pass all integration and unit tests locally
make integration-test
make unit-test
- Run benchmarks and profiler to check performance
make benchmark
- Update
config-reference.md
andconfig.man
if any config changes and generate manpagemake gen-man
- Update
Makefile
andCHANGELOG.md
with correct version, and add all changes toCHANGELOG.md
- Squash-merge to main with
Release vx.y.z
and description of changes - Run
make release
, which will:- Create a git tag with release notes
- Trigger a build in Github that builds cross-platform binaries and generates release notes of changes between current and previous tag
Overview of How Sake Works
- Parse & validate CLI arguments
- Parse
sake
config files and create config, inventory, tasks, specs, and target states - Create clients for remote and local task execution for the selected hosts/tasks
- Execute tasks on remote/local hosts
- Disconnect from remote hosts
- Print any output (results, reports, errors, etc.)
Dependency Graph
Create SVG dependency graphs using graphviz and goda.
goda graph "github.com/alajmo/sake/..." | dot -Tsvg -o res/graph.svg
goda graph "github.com/alajmo/sake:all" | dot -Tsvg -o res/graph-full.svg