Skip to content
Merged
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: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The new release version is **[VERSION]**

Please complete these steps in order.

- [ ] Update the top-level README.md with links to new modules (run `./docs/helpers/generate_readme_fragment.py`)
- [ ] Update the version number in galaxy.yml e.g. `1.1.1`
- [ ] Update the changelog with `antsibull-changelog` e.g. `antsibull-changelog release --version 1.1.1`
- [ ] Tag the commit with the version number prefixed with 'v' e.g. `v1.1.1`
- [ ] Deploy new documentation using gh-pages - "Deploy static content to Pages"
1 change: 1 addition & 0 deletions docs.requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Sphinx
sphinx-rtd-theme
ansible-doc-extractor
# antsibull-docs
antsibull-changelog
35 changes: 25 additions & 10 deletions docs/helpers/generate_readme_fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# URL with uploaded docs/build/html content
DOCS_URL = "https://scalecomputing.github.io/HyperCoreAnsibleCollection"
FQCN = "scale_computing.hypercore"
README_FILE = "README.md"


def list_plugins(module_type):
Expand Down Expand Up @@ -93,23 +94,37 @@ def list_roles():
return fragment


def print_fragment(fragment, fragment_name):
print(f"<!--start {fragment_name} list-->")
print(f"<!-- generated by {__file__.strip(os.getcwd()) + 'py'} -->")
print(f"| {fragment_name} | Description |")
print("| --- | --- |")
print(fragment.rstrip("\n"))
print(f"<!--end {fragment_name} list-->")
def update_fragment(fragment, fragment_name):
fragment_no_newline = fragment.rstrip("\n")
header0 = f"<!--start {fragment_name} list-->"
header1 = f"<!--end {fragment_name} list-->"
full_fragment = f"""{header0}
<!-- generated by {__file__.strip(os.getcwd()) + 'py'} -->
| {fragment_name} | Description |
| --- | --- |
{fragment_no_newline}
{header1}"""
# print(full_fragment)
with open(README_FILE, "r") as ff:
content = ff.read()
pos0 = content.find(header0)
pos1 = content.find(header1) + len(header1)
assert pos0 >= 0
assert pos1 >= 0
new_content = content[:pos0] + full_fragment + content[pos1:]
with open(README_FILE, "w") as ff:
ff.write(new_content)
logger.info("Fragment '%s' written to file", fragment_name)


def main():
modules_fragment = list_plugins("module")
inventories_fragment = list_plugins("inventory")
roles_fragment = list_roles()

print_fragment(inventories_fragment, "Inventory plugin name")
print_fragment(modules_fragment, "Module name")
print_fragment(roles_fragment, "Role name")
update_fragment(inventories_fragment, "Inventory plugin name")
update_fragment(modules_fragment, "Module name")
update_fragment(roles_fragment, "Role name")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: scale_computing
name: hypercore
version: 1.2.0
version: 1.3.0-dev0
readme: README.md
authors:
- XLAB Steampunk <steampunk@xlab.si>
Expand Down