Skip to main content

Automatic Updates for Kustomize Resources

Project description

PyPI

lennybot

Usage

GitHub Actions

- uses: raynigon/lennybot@v1.0.0
  env:
    LB_CONFIG_FILE: ".github/lennybot.yaml"
    LB_GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

CLI

Install package with pip install lennybot. To start the application run the lennybot command. You can specify the Action which should be executed. This action can be "ci", "plan" or "apply". The CI CLI action executed apply and handles git operations such as, commit and branch creation. The plan action allows to plan updates and save the plan for later. The apply action can either execute an existing plan, or create a new plan and apply it immediately.

Docker

To run the lennybot as docker image execute:

docker run --rm -v "$(pwd):/workspace/ raynigon/lennybot

How it works

The lennybot allows to define multiple applications. Each application has to have a version source, which can be queried to determine the latest version. If a newer version is available, the lennybot executes multiple pre defined actions per application. E.g. Update Docker Image Tags. The applications, sources and actions can be configured in the config.yml file. For more information see below.

Configuration

The lennybot can be configured via the config.yml file and environment variables.

If the config.yml file is not in the root of the current working directory, the LB_CONFIG_FILEenvironment variable can be used to pass the location of the configuration file to the lennybot.

The configuration file has multiple top level objects. Each section represents a configuration object.

State

Path Description
state.file The state file which is used to store the version of each application

GitHub

Path Description
state.file The state file which is used to store the version of each application
state.pr.enabled Toggle PR creation in CI mode. Has to be either true or false
state.pr.repository The name of the repository in github on which the PR should be created
state.pr.branchPrefix Prefix for the branch name which should be used to create the PRs

Applications

Path Description
applications[*].name The name of the application which should be updated
applications[*].source.type The source has to be either of the type "github" or of the type "github-query". See below for details.
applications[*].source.repository The GitHub Repository which should be used to determine the latest version
applications[*].source.regex The regex pattern which is used to extract the semver version code from the tag value
applications[*].actions[*].type The action has to be one of these types "image-tag-update", "download-resources" or "update-yaml". See below for details.
applications[*].actions[*].url
applications[*].actions[*].target
applications[*].actions[*].image
applications[*].actions[*].kustomizePath
applications[*].actions[*].tagPattern
applications[*].actions[*].targetFile
applications[*].actions[*].yamlPath
applications[*].actions[*].valuePattern

GitHub Source

GitHub Query Source

Image Tag Update Action

Download Resource Action

Update YAML Action

Update Dockerfile Action

Origin

One upon time a colleague (Lenny) left my team. Besides being an Apache Solr genius, one of the tasks he really liked doing, was the updating of the dependencies in our applications. Since everyone else in the team didnt like this job, we needed some automation for this. The lennybot was born to replace our colleague. Since then the lennybot evolved and finally got replaced by the dependabot. Some years later i needed a solution to upgrade components managed with kustomize. This lead to the creation of a new lennybot which is able to automatically search for updates and upgrades the resources with their latest versions.

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

lennybot-1.0.15.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lennybot-1.0.15-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file lennybot-1.0.15.tar.gz.

File metadata

  • Download URL: lennybot-1.0.15.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for lennybot-1.0.15.tar.gz
Algorithm Hash digest
SHA256 d1c6be1b1988020744c3d3247439ada789220808d8e8084d008b5f60ac112783
MD5 9915eacd5285168ac54aeee1c4bfce98
BLAKE2b-256 56729a87cee158370099df5832e6fbcf69aafc6a416fc46fb933d037f34fdbc0

See more details on using hashes here.

File details

Details for the file lennybot-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: lennybot-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for lennybot-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 cf54af1b24f40f810c71ae36a949cdc5bb59f5f15f21a501f02bec298eb5dd4f
MD5 7e2a93a29aecfc05a4686cda6b3e11d4
BLAKE2b-256 a605e5a243415ed52db7491b0de1cdaba9977711827b1e46093e464fff02346a

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