mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
- Add utils/docker/version_updater.py with CLI for updating Docker image versions - Add cli/fix/docker_image_versions module wrapping the updater - Add .github/workflows/update.yml replacing update-skills.yml - Add scripts/github/ helpers: check_git_changes, install_update_python, open_update_pr, update_docker_image_versions - Add tests/lint/filesystem/ for scripts/ and utils/ folder file-type enforcement - Add tests/lint/ansible/ for legacy module usage and vars usage checks - Reorganize tests/lint/repository/ and move test_vars_usage_in_yaml.py to ansible/ - Add artefact docs: files/github/workflow.md, scripst.md, utils.md - Apply documentation.md standards to all modified markdown files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
58 lines
1.5 KiB
Python
58 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
from pathlib import Path
|
|
|
|
from utils.docker.version_updater import apply_updates, find_outdated_updates
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(
|
|
description="Update semver-based Docker image versions in web-*/config/main.yml."
|
|
)
|
|
parser.add_argument(
|
|
"--repo-root",
|
|
type=Path,
|
|
default=Path(__file__).resolve().parents[3],
|
|
help="Repository root to scan and update",
|
|
)
|
|
parser.add_argument(
|
|
"--dry-run",
|
|
action="store_true",
|
|
help="Print planned updates without modifying files",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
repo_root = args.repo_root.resolve()
|
|
updates = find_outdated_updates(repo_root)
|
|
|
|
if not updates:
|
|
print("Docker image versions are already up to date.")
|
|
return 0
|
|
|
|
print("Planned Docker image updates:")
|
|
for update in updates:
|
|
rel_path = update.entry.config_path.relative_to(repo_root)
|
|
print(
|
|
f"- {rel_path}:{update.entry.service} "
|
|
f"{update.entry.image} {update.entry.version} -> {update.latest}"
|
|
)
|
|
|
|
if args.dry_run:
|
|
return 0
|
|
|
|
changed_paths = apply_updates(updates)
|
|
if changed_paths:
|
|
print("\nUpdated files:")
|
|
for path in changed_paths:
|
|
print(f"- {path.relative_to(repo_root)}")
|
|
else:
|
|
print("\nNo files changed.")
|
|
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|