Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep the check of galaxy docs #1

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ansible_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/scripts/check_galaxy_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ]]
Expand All @@ -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