mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
Update versions in README.md with pre-commit
Currently, versions in README.md need to be manually updated, and we check it's done with a bash script. Add a small utility playbook to add versions in README.md from their actual default values, automatically. This is done in pre-commit, and replace the scripted check ; instead it will autofix the README.md, and fails in CI if needed. We switch markdownlint behind the local hooks to gave it the opportunity to catch a problem with the rendering.
This commit is contained in:
22
scripts/render_readme_version.yml
Executable file
22
scripts/render_readme_version.yml
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- name: Update README.md versions
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
vars:
|
||||
fallback_ip: 'bypass tasks in kubespray-defaults'
|
||||
roles:
|
||||
- kubespray-defaults
|
||||
tasks:
|
||||
- name: Include versions not in kubespray-defaults
|
||||
include_vars: "{{ item }}"
|
||||
loop:
|
||||
- ../roles/container-engine/docker/defaults/main.yml
|
||||
- ../roles/kubernetes/node/defaults/main.yml
|
||||
- ../roles/kubernetes-apps/argocd/defaults/main.yml
|
||||
- name: Render versions in README.md
|
||||
blockinfile:
|
||||
marker: '[//]: # {mark} ANSIBLE MANAGED BLOCK'
|
||||
block: "\n{{ lookup('ansible.builtin.template', 'readme_versions.md.j2') }}\n\n"
|
||||
path: ../README.md
|
||||
Reference in New Issue
Block a user