Skip to main content

Fetches metadata from Terraform releases

Project description

tfver

Terraform tool for fetching release metadata

Description

Welcome to the tfver repo. This Python command line utility fetches Terraform release metadata, filters releases based on query, generates release tags, and returns the results in your desired output format [text|json|yaml]. It was built with CI/CD in mind.

Tags

Release tags generated by tfver follow the following naming convention. In this example hansohn/terraform is a docker image that been tagged using this tool.

# tag formats
hansohn/terraform:latest        latest release of Terraform
hansohn/terraform:1             latest 1.x.x version release of Terraform
hansohn/terraform:1.2           latest 1.2.x version release of Terraform
hansohn/terraform:1.2.3         1.2.3 version of Terraform

Usage

Commands

$ tfver --help
Usage: tfver [OPTIONS]

  Gathers a historical list of Terraform versions and their metadata. Produces
  a filtered response based on arguement inputs.

Options:
  -c, --count INTEGER            Return latest N number of minor release
                                 versions.  [default: 1]
  -r, --regex TEXT               Filter release versions using regex pattern
                                 matching. example: '^(0.15|1)$'
  -b, --build TEXT               Filter build versions by platform os and
                                 arch. example: 'os=linux,arch=amd64'
  -t, --tag-template TEXT        Format tags to templatized string. String
                                 template must include '{tag}' keyword which
                                 will be replaced with actual tag value during
                                 formatting. example: 'foo/bar:{tag}-dev'
  -o, --output [text|json|yaml]  The formatting style for command output.
                                 [default: json]
  -L, --vlist                    Reformats 'versions' key to list of dicts.
                                 Defaults to key/value version dicts.
  -M, --major                    Includes major version tag in metadata of all
                                 lastest major version releases. example:
                                 1.2.3 -> 1
  -m, --minor                    Includes minor version tag in metadata of all
                                 lastest minor version releases. example:
                                 1.2.3 -> 1.2
  -p, --prerelease               Include pre-release versions in response.
  -v, --verbose                  Include all release metadata in response.
  -V, --verboseb                 Include all release metadata and all builds
                                 in response.
  --version                      Show the version and exit.
  --help                         Show this message and exit.

Makefile

Additionally, a Makefile has been included in this repo to assist with common development-related functions. I've included the following make targets for convenience:

Available targets:

  build                               Build python package
  clean                               Clean everything
  clean/build                         Clean python build directories
  clean/docker                        Clean docker build images
  clean/venv                          Clean virtual environment directory
  docker                              Docker launch testing environment
  docker/build                        Docker build image
  docker/lint                         Lint Dockerfile
  docker/push                         Docker push image
  docker/run                          Docker run image
  help                                Help screen
  help/all                            Display help for all targets
  help/short                          This help short screen
  lint                                Run all linters, validators, and security analyzers
  lint/bandit                         Python security linter
  lint/black                          Python code formatter
  lint/flake8                         Python styleguide enforcement
  lint/mypy                           Python static typing
  lint/pylint                         Python linter
  python/build                        Python build package
  python/packages                     Python install packages from requirements file(s)
  python/venv                         Python configure virtual environment
  upload/check                        Python upload check
  upload/pypi                         Python upload package to pypi
  upload/testpypi                     Python upload package to testpypi
  venv                                Create virtual environment and install requirements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfver-1.1.1.tar.gz (24.9 kB view details)

Uploaded Source

File details

Details for the file tfver-1.1.1.tar.gz.

File metadata

  • Download URL: tfver-1.1.1.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tfver-1.1.1.tar.gz
Algorithm Hash digest
SHA256 15f47a066d20d1b7b3e6df88ec2fd54660dafc0e4aac4c9d1ab3a17cbaa6ad8d
MD5 8bc8987f105584297e075bf1856bd0db
BLAKE2b-256 914ce755b8a5cb26478bd5edb49707bad0be2f83be87a755dbf676a790a1b91d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page