Package: dcs-release-check
Release CheckTool to query latest versions from source code hosting platforms such as GitHub.Currently supported are the following platforms:GitHubInstallationTo install the package runpip install dcs-release-check.
It will register itself as a CLI appliction with the namerelease-check.
Learn more about all available commands userelease-check --help.Note this tool requires Python>=3.8 to run.UsageAll available command require to identify the repository.
The URI of a repository is given by the host of the platform, e.g.github.com, and an identifier for the repository, e.g.username/repo_name.
So for example the repositoryhttps://github.com/nextcloud/serveris described by the URIgithub.com:nextcloud/server.Single Repository QueriesTo query the most recent version of a single repository, use thesinglesub-command:$release-checksinglegithub.com:nextcloud/server20.0.6The default assumption is that stable releases do use asemveridentifier, so that the regex^.*?(\d+\.\d+\.\d+)$matches version tags.
While this holds true for most of the repositories, some repositories don't follow this convention and require custom rules.
One of those respositories isdocker-pi-holewhich uses release tags such asv5.6.
The underlying regex pattern can be changed with the--patternparameter:$release-checksinglegithub.com:pi-hole/docker-pi-hole--pattern'^.*?(\d+\.\d+(\.\d+)?)$'5.6Batch QueriesTo query multiple repositories all at once, a simple configuration file written in TOML format can be used.[repos.github]"nextcloud/server"="default""apache/airflow"="^(\\d+\\.\\d+\\.\\d+)$""matrix-org/synapse"="default"The first line refers to thenextcloud/serverrepository on GitHub.
Thedefault regexcovers most of the use-cases to extract version information from tag names, but it might be adjusted as seen in line 2 with theapache/airflowrepository.To receive the latest versions, simply pass this path to therelease-checkCLI tool.$release-checkbatch--config./config/sample.tomlrepository          latest_version    updated     host------------------  ----------------  ----------  ----------apache/airflow      2.0.0             2020-12-18  github.commatrix-org/synapse  1.26.0            2021-01-27  github.comnextcloud/server    20.0.6            2021-01-25  github.comTo process the output with other tools, the--format=jsonoption can be used.$release-checkbatch--config/path/to/config.toml--format=json[{"host": "github.com", "repository": "apache/airflow", "latest_version": "2.0.0", "updated": "2020-12-18"}, {"host": "github.com", "repository": "matrix-org/synapse", "latest_version": "1.25.0", "updated": "2021-01-13"}, {"host": "github.com", "repository": "nextcloud/server", "latest_version": "20.0.5", "updated": "2021-01-14"}]DockerIf docker containers are labeled with a few standard labels, this tool is able to compare the running versions of those containers with the most recent upstream versions.To make this work seamlessly the following labels must be set on the containers:labels:
    me.dotcs.monitor/app.name: load-balancer
    me.dotcs.monitor/app.repo-uri:github.com:nginx/nginx
    me.dotcs.monitor/app.version: 1.19.6To define a custom pattern useme.dotcs.monitor/app.version-patternand pass a customized regex.Runningrelease-check dockerwill automatically scan through all running containers and match the running version against the most recent upstream versions.Application    Container name           Installed version    Available version    Update available-------------  -----------------------  -------------------  -------------------  ------------------load-balancer  lb_nginx_1               1.19.6               1.19.6pihole         pihole_pihole_1          5.5.1                5.6                  xBy default only running containers will be queried.
This can be changed by using the--allflag.DevelopmentInstall the repoistory with development dependencies via pip:$pipinstall--editable".[develop]"