This is a CLI tool that allows to run a command after acquiring a file lock, allowing to coordinate the execution of multiple commands that call lock
independently.
It's born out of CircleCI running multiple pipelines at the same time due to Dependabot updates. This in the end would cause docker-compose
to be run multiple times in parallel, which seems to cause some timeout errors. Now, everybody should wait for their turn.
Run ./go
to see all the actions that can be performed.
Inspired by this guide, I'm cross compiling this from OSX to linux using musl
. Two extra libraries are needed before build:
# Build linux binaries from OSX
rustup target add x86_64-unknown-linux-musl
# Make smaller binaries
brew install upx
Then run ./go build-release
to build a binary.
Download the latest binary release and put it on your PATH.
Run lock -h
to see the different options.