Skip to main content

A python `values.yaml` helm updater cli.

Project description

⎈ helm_tag_updater

A python CLI application which updates a helm `values.yaml` image tag

Introducing

helm_tag_updater is a python cli tool which can update values.yaml fields inside a CI/CD pipeline. Also it's an easy to use tool for implementing GitOps principles.

Why helm_tag_updater / Alternatives

helm_tag_updater is a simple to use cli which is also support regular expression tag matching and prod mode.

Tool Easy to use Additional setup required Additional checks
helm_tag_updater No additional setup required Regular expression matching, production mode
yq No additional setup required, but yq breaks yaml structure (https://github.com/mikefarah/yq/issues/1248)
kustomize Require additional kustomization.yaml file
sed Supported by all Linux systems
  • You can setup tag checking and regular expression matching using linux tools, but helm_tag_updater support it out of the box

Installation

You can install helm_tag_updater using:

Docker

docker pull fayvori/helm_tag_updater

pip

pip install helm_tag_updater

Usage

helm_image_updater tag

flag default purpose
--help, -h None Prints help message and exit
--tag, -t None Tag that should be applied on values.yaml file. NOTE: If you set -p or --prod flag tag should match regular expression -e --expression flag
--filepath,   -f None Path to the values.yaml file
--prod, -p False Enables prod mode (e.g. enables regular expression matching)
--expression, -e v[0-9].[0-9].[0-9] Expression that tag should match if prod mode is enabled
--yaml_path, -y image.tag A field that should be changed, nested fields separated with

Quick start

For quick start you can run helm_tag_updater locally in a container and download examples/manifest.yaml file.

docker run -it --rm --name helm_tag_updater fayvori/helm_tag_updater:1.0 /bin/sh
wget https://raw.githubusercontent.com/fayvori/helm_tag_updater/main/examples/manifest.yaml

Update tag in development mode

helm_tag_updater -t 3c5aec6 -f $(pwd)/manifest.yaml

cat manifest.yaml | head -n 15

dev update

Production mode regular expression matching (for default value see Usage)

helm_tag_updater -t v0.0.1 -f $(pwd)/manifest.yaml -p

cat manifest.yaml | head -n 15

prod mode

Attempt to run in production mode with not matching tag

prod mode attempt

Running with custom tag matching regular expression and yaml path

custom tag matching and yaml path

Contributing

If you want to submit a pull request to fix a bug or enhance an existing feature, please first open an issue and link to that issue when you submit your pull request.

If you have any questions about a possible submission, feel free to open an issue too.

Pull request process

  1. Fork this repository
  2. Create a branch in your fork to implement the changes. We recommend using the issue number as part of your branch name, e.g. 1234-fixes
  3. Ensure that any documentation is updated with the changes that are required by your fix.
  4. Ensure that any samples are updated if the base image has been changed.
  5. Submit the pull request. Do not leave the pull request blank. Explain exactly what your changes are meant to do and provide simple steps on how to validate your changes. Ensure that you reference the issue you created as well. The pull request will be review before it is merged.

Made by

License

MIT License

Copyright (c) 2023 Ignat Belousov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

helm_tag_updater-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

helm_tag_updater-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file helm_tag_updater-0.0.1.tar.gz.

File metadata

  • Download URL: helm_tag_updater-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for helm_tag_updater-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c0e634f3730c7f06bfbc2d5b3db6846688b23274c2a8120a40c80d4b622234e2
MD5 8de49239c56c4f3be081ba29a3835aba
BLAKE2b-256 9b6207e6fe8c9cfa0bc0b31d95ba958e99e561116c0fc503f03ff5e70ae2bd97

See more details on using hashes here.

File details

Details for the file helm_tag_updater-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: helm_tag_updater-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for helm_tag_updater-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2de39388beefda1a76e9bb7c65de87bb1c4aca9a00cf51a2e7a98badeba250b9
MD5 839f23f7870d11111878051eb626abd2
BLAKE2b-256 91c4ab76ba77dbd46f3472e630f96ee1f7bb8c271e06671a35c41c0e3cc6c34d

See more details on using hashes here.

Supported by

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