adnv CLI
Installation
From crates.io
$ cargo install adnv
With Nix
$ nix profile install gitlab:adnap/tools/adnv # install
$ nix run gitlab:adnap/tools/adnv -- outdated # run once, install nothing
As a container
Two images are published per release. The distroless one is the smaller of the
two; the dslim- one carries a shell, which GitLab CI requires of a job image:
adnv:outdated:
image: registry.gitlab.com/adnap/tools/adnv:dslim-v1.5.1
script:
- adnv outdated
$ podman run --rm -v "$PWD:/work" -w /work \
registry.gitlab.com/adnap/tools/adnv:v1.5.1 adnv outdated
From source
$ cargo install --git https://gitlab.com/adnap/tools/adnv.git --tag v1.5.1 # release
$ cargo install --git https://gitlab.com/adnap/tools/adnv.git --branch develop
Development
$ nix develop
Gives the toolchain rust-toolchain.toml pins — the one CI uses — plus
cargo-llvm-cov, convco and glab. Without Nix, install that toolchain and
the cmake, perl and pkg-config that aws-lc-sys and libgit2 need.
Usage
Config file
Default config file is "adnv.yml" in current path.
The default config file can be overwritten withADNV_CONFIG_FILEenvironment variable. It can be the path to the config file, or the path to a directory that contains a config file named "adnv.yml".
All can be overwritten calling CLI with config : adnv [-c/--config <CONFIG_FILE>] <COMMAND>.
Run
Check
Outdated
Update
Inline Hints (Common to update & outdated)
In terraform files, inner dependencies in terraform modules can also be tracked using Inline hints.
A Inline Hint is a templated comment :
# @adnv source "<FORMATED_URL>" "<VERSION_CONSTRAINT>"
where FORMATED_URL can either be :
- a helm repository :
helm+<REPOSITORY_URL>#name=<NAME> - a gitlab repository :
terraform://<REPOSITORY_URL>
VERSION_CONSTRAINT must respect semver (if helm) ou terraform versioning format (if terraform).
Outdated and Update commands will consider the Inline Hint line as instruction to process the first next line.
Example