Installation, example • Usage • Configuration • TODO • License
version-enforcer
is a tool that enforces software version compliance. It is a
simple tool that can be used in CI pipelines and developer hosts to ensure that
the correct versions of software are installed.
This will install version-enforcer
to your GOPATH
, which by default is ~/go
.
go install -v github.com/asimihsan/version-enforcer@0.0.8
Then create a config file:
tee version-enforcer.hcl <<EOF > /dev/null
binary "git" {
version = "~2"
}
binary "make" {
version = "^4.2.1"
}
EOF
Finally, run version-enforcer
:
version-enforcer --config version-enforcer.hcl
$ version-enforcer --help
Enforce tool versions
Usage:
enforce --config <config file> [flags]
Flags:
--config string config file (e.g. version-enforcer.hcl)
-h, --help help for enforce
-v, --verbose verbose output
For example, you could run:
$ version-enforcer --config version-enforcer.hcl
Here is an example configuration file that specifies that
make
must be exactly4.2.1
, andgit
must be between>= 2.0.0
and< 3.0.0
.
binary "git" {
version = "~2"
}
binary "make" {
version = "^4.2.1"
}
The requirement specifications follow https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
- Add support for
library
requirements. - Output binary path in error messages.
This project is licensed under the Apache License, Version 2.0. See LICENSE for details.