version-enforcer

command module
v0.0.0-...-e84a8d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL