Skip to content

asimihsan/version-enforcer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version-enforcer

Enforce software version compliance.

Installation, exampleUsageConfigurationTODOLicense

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.

Installation, example

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

Usage

$ 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

Configuration

Here is an example configuration file that specifies that

  • make must be exactly 4.2.1, and
  • git 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.

TODO

  • Add support for library requirements.
  • Output binary path in error messages.

License

This project is licensed under the Apache License, Version 2.0. See LICENSE for details.

About

Enforce software version compliance.

Resources

License

Stars

Watchers

Forks

Packages

No packages published