From 98cea56ec317f2640ffee652964d59758416137c Mon Sep 17 00:00:00 2001 From: Kay Yan Date: Tue, 9 Jan 2024 07:27:02 +0000 Subject: [PATCH] keep the check of docs --- docs/ansible_collection.md | 2 +- tests/scripts/check_galaxy_version.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/ansible_collection.md b/docs/ansible_collection.md index bcf23baa391..cbe1ad2c5e5 100644 --- a/docs/ansible_collection.md +++ b/docs/ansible_collection.md @@ -15,7 +15,7 @@ Kubespray can be installed as an [Ansible collection](https://docs.ansible.com/a collections: - name: https://github.com/kubernetes-sigs/kubespray type: git - version: master # use the appropriate tag or branch for the version you need + version: v2.23.1 ``` 2. Install your collection diff --git a/tests/scripts/check_galaxy_version.sh b/tests/scripts/check_galaxy_version.sh index d663f121f07..7edb90a27fd 100755 --- a/tests/scripts/check_galaxy_version.sh +++ b/tests/scripts/check_galaxy_version.sh @@ -2,6 +2,7 @@ set -e version_from_galaxy=$(grep "^version:" galaxy.yml | awk '{print $2}') +version_from_docs=$(grep -P "^\s+version:\sv\d+\.\d+\.\d+" docs/ansible_collection.md | awk '{print $2}') # TODO: compute the next expected version somehow if [[ $KUBESPRAY_VERSION == "v${version_from_galaxy}" ]] @@ -10,3 +11,11 @@ then echo "Be sure to remove the \"v\" to adhere to semantic versioning" exit 1 fi + +if [[ $KUBESPRAY_VERSION != "${version_from_docs}" ]] +then + echo "Please update the documentation for Ansible collections under docs/ansible_collection.md to reflect the KUBESPRAY_VERSION" + echo "Please update galaxy.yml version to match the next KUBESPRAY_VERSION." + echo "Be sure to remove the \"v\" to adhere to semantic versioning" + exit 1 +fi \ No newline at end of file