From 2fbdfe4367d777ce20cb2a81cad22aec09dfb6c2 Mon Sep 17 00:00:00 2001 From: Aine Date: Fri, 12 Apr 2024 21:19:28 +0300 Subject: [PATCH] add versions generator --- VERSIONS.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ bin/versions.py | 61 +++++++++++++++++++++++++++++++++++++ justfile | 7 ++++- 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 VERSIONS.md create mode 100755 bin/versions.py diff --git a/VERSIONS.md b/VERSIONS.md new file mode 100644 index 0000000..1471d69 --- /dev/null +++ b/VERSIONS.md @@ -0,0 +1,81 @@ +* Adguard Home: v0.107.46 +* Apisix Dashboard: 3.0.1 +* Apisix Gateway: 3.8.0 +* Appsmith: v1.9.50 +* Authelia: 4.37.5 +* Authentik: 2024.2.2 +* Borg: 1.2.8 +* Borgmatic: 1.8.9 +* Changedetection: 0.45.17 +* Changedetection Playwright Driver: latest +* Clickhouse: 23.10.5.20 +* Collabora Online: 22.05.13.1.1 +* Container Socket Proxy: 0.1.2 +* Docker Compose: v2.11.1 +* Docker Registry: 2.8.3 +* Docker Registry Browser: 1.6.1 +* Docker Registry Proxy: v1.2.0 +* Docker Registry Purger: 1.0.0 +* Echoip: latest +* Etcd: 3.5.11 +* Exim Relay: 4.97.1-r0-0 +* Firezone: 0.7.35 +* Focalboard: 7.10.4 +* Forgejo: 1.21.10-0 +* Freshrss: 1.23.0 +* Funkwhale: 1.4.0 +* Gitea: 1.21.10 +* Gotosocial: 0.15.0 +* Grafana: 10.4.2 +* Healthchecks: v3.3 +* Hubsite Nginx: 1.25.4 +* Ilmo: 1.0.4 +* Infisical: v0.3.8 +* Influxdb: 2.7.5 +* Jitsi: stable-9364-1 +* Jitsi Ldap: 3 +* Jitsi Prosody Auth Matrix User Verification Repo: 2839499cb03894d8cfc3e5b2219441427cb133d8 +* Keycloak: 24.0.2 +* Keydb: 6.3.4 +* Lago: v0.50.0-beta +* Languagetool: 6.3 +* Linkding: latest +* Loki: 2.9.4 +* Miniflux: 2.1.2 +* Mobilizon: 3.1.0 +* Mongodb: 7.0.4 +* Mosquitto: 2.0.15 +* Mrs: latest +* N8N: next +* Navidrome: 0.51.1 +* Netbox: v3.7.0-2.8.0 +* Netbox Container Image Customizations Keycloak Sso Expiration Middleware: a2ac39b1c73a50742c6e834e89162f87528c7f73 +* Nextcloud: 28.0.2 +* Outline: 0.74.0-0 +* Owncast: 0.1.2 +* Oxitraffic: 0.9.0 +* Peertube: v6.0.4 +* Prometheus: v2.51.2 +* Prometheus Blackbox Exporter: v0.25.0 +* Prometheus Node Exporter: v1.7.0 +* Prometheus Postgres Exporter: v0.14.0 +* Prometheus Ssh Exporter: v1.5.0 +* Promtail: 2.9.5 +* Radicale: 3.1.9.1 +* Redis: 7.2.4 +* Redmine: 5.1.2 +* Roundcube: 1.6.6 +* Rumqttd: 0.21.0 +* Semaphore: 2.9.56 +* Soft Serve: v0.4.7 +* Syncthing: 1.27.6 +* Tandoor Api: 1.5.17 +* Tandoor Frontend: 1.25.4-alpine +* Telegraf: 1.27.1 +* Traefik: v2.11.2 +* Uptime Kuma: 1.23.11 +* Vaultwarden: 1.30.5 +* Wetty: 2.5 +* Wg Easy: 7 +* Woodpecker Ci Agent: v2.4.1 +* Woodpecker Ci Server: v2.4.1 diff --git a/bin/versions.py b/bin/versions.py new file mode 100755 index 0000000..a191c2c --- /dev/null +++ b/bin/versions.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import re +import yaml + +ignored = [ + 'matrix_synapse_default_room_version', +] +prefixes = [ + 'matrix_', + 'custom_', + 'int_', + 'synapse_default_', + 'synapse_ext_', + 'mailer_container_', + 'bot_', + 'client_', + 'mautrix_', + 'devture_', + 'beeper_', + 'backup_borg_', +] +suffixes = [ + '_version', +] + + +def find_versions(): + matches = {} + for root, dirs, files in os.walk('.'): + if root.endswith('defaults'): + for file in files: + if file.endswith('main.yml'): + path = os.path.join(root, file) + with open(path, 'r') as f: + data = yaml.safe_load(f) + for key, value in data.items(): + if key.endswith('_version') and value and not re.search(r'{{|master|main|""', str(value)) and key not in ignored: + sanitized_key = sanitize_key(key) + matches[sanitized_key] = value + return matches + + +def sanitize_key(key): + for prefix in prefixes: + key = key.removeprefix(prefix) + for suffix in suffixes: + key = key.removesuffix(suffix) + return key.replace('_', ' ').title() + + +def generate_versions(): + versions = find_versions() + with open(os.path.join(os.getcwd(), 'VERSIONS.md'), 'w') as f: + for key, value in sorted(versions.items()): + f.write(f'* {key}: {value}\n') + + +if __name__ == "__main__": + generate_versions() diff --git a/justfile b/justfile index 67ea5f6..0c2d9f8 100644 --- a/justfile +++ b/justfile @@ -69,7 +69,7 @@ _optimize-for-var-paths +PATHS: --dst-group-vars-yml-path={{ justfile_directory() }}/group_vars/mash_servers # Updates requirements.yml if there are any new tags available. Requires agru -update: && opml +update: && opml versions @agru -r {{ templates_directory_path }}/requirements.yml -u # Runs ansible-lint against all roles in the playbook @@ -81,6 +81,11 @@ opml: @echo "generating opml..." @python bin/feeds.py . dump +# dumps versions of the components found in the roles to the VERSIONS.md file +versions: + @echo "generating versions..." + @python bin/versions.py + # Runs the playbook with --tags=install-all,start and optional arguments install-all *extra_args: (run-tags "install-all,start" extra_args)