1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

Add extra sanity tests and changelog generator

This commit is contained in:
Lukas Kämmerling 2020-06-25 08:28:12 +02:00
parent ee4ef2317d
commit b99df8205e
12 changed files with 108 additions and 3 deletions

View file

@ -4,3 +4,18 @@ Ansible Collection: hetzner.hcloud
=================================================
Ansible Hetzner Cloud Collection for controlling your Hetzner Cloud Resources.
## Release notes
See [here](https://github.com/ansible-collections/hetzner.hcloud/tree/master/CHANGELOG.rst).
## Publishing New Version
TBD Basic instructions without release branches:
1. Create `changelogs/fragments/<version>.yml` with `release_summary:` section (which must be a string, not a list).
2. Run `antsibull-changelog release --collection-flatmap yes`
3. Make sure `CHANGELOG.rst` and `changelogs/changelog.yaml` are added to git, and the deleted fragments have been removed.
4. Tag the commit with `<version>`. Push changes and tag to the main repository.

1
changelogs/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.plugin-cache.yaml

28
changelogs/config.yaml Normal file
View file

@ -0,0 +1,28 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Hetzner Cloud

View file

@ -3,10 +3,13 @@ name: hcloud
version: 0.1.0
readme: README.md
authors:
- Lukas Kaemmerling (github.com/LKaemmerling)
- Hetzner Cloud (github.com/hetznercloud)
description: A Collection for managing Hetzner Cloud resources
license: GPL-3.0-or-later
tags: null
tags:
- hetzner
- cloud
- hcloud
dependencies:
ansible.netcommon: '>=0.0.1'
repository: https://github.com:ansible-collections/hetzner.hcloud

View file

@ -1,3 +1,4 @@
requires_ansible: '>=2.9.10'
plugin_routing:
modules:
hcloud_location_facts:

View file

@ -12,6 +12,7 @@ matrix:
- env: T=devel/sanity/2
- env: T=devel/sanity/3
- env: T=devel/sanity/4
- env: T=devel/sanity/extra
- env: T=devel/hcloud/3.8/1
- env: T=devel/hcloud/3.8/2
@ -21,6 +22,7 @@ matrix:
- env: T=2.10/sanity/2
- env: T=2.10/sanity/3
- env: T=2.10/sanity/4
- env: T=2.10/sanity/extra
- env: T=2.10/hcloud/3.8/1
- env: T=2.10/hcloud/3.8/2

View file

@ -0,0 +1,13 @@
{
"python": "3.8",
"output": "path-line-column-message",
"prefixes": [
"changelogs/fragments/"
],
"exclude_prefixes": [
"changelogs/fragments/."
],
"requirements": [
"git+git://github.com/ansible-community/ansibulled.git@pip-installable#egg=ansibulled"
]
}

View file

@ -0,0 +1,29 @@
#!/usr/bin/env python
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
import subprocess
def main():
paths = sys.argv[1:] or sys.stdin.read().splitlines()
allowed_extensions = ('.yml', '.yaml')
for path in paths:
ext = os.path.splitext(path)[1]
if ext not in allowed_extensions:
print('%s:%d:%d: extension must be one of: %s' % (path, 0, 0, ', '.join(allowed_extensions)))
cmd = ['ansibulled-changelog', 'lint'] + paths
subprocess.check_call(cmd)
if __name__ == '__main__':
main()

View file

@ -53,7 +53,8 @@ cd "${TEST_DIR}"
# STAR: HACK install dependencies
retry ansible-galaxy -vvv collection install community.general
retry ansible-galaxy -vvv collection install ansible.netcommon
# retry ansible-galaxy -vvv collection install community.internal_test_tools - we need git checkout until 0.2.0 has been released
retry git clone https://github.com/ansible-collections/community.internal_test_tools.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/internal_test_tools"
retry pip install netaddr --disable-pip-version-check
retry pip install hcloud
# END: HACK

View file

@ -13,6 +13,11 @@ else
base_branch=""
fi
if [ "${group}" == "extra" ]; then
../internal_test_tools/tools/run.py --color
exit
fi
case "${group}" in
1) options=(--skip-test pylint --skip-test ansible-doc --skip-test validate-modules) ;;
2) options=( --test ansible-doc --test validate-modules) ;;

View file

@ -13,6 +13,11 @@ else
base_branch=""
fi
if [ "${group}" == "extra" ]; then
../internal_test_tools/tools/run.py --color
exit
fi
case "${group}" in
1) options=(--skip-test pylint --skip-test ansible-doc --skip-test validate-modules) ;;
2) options=( --test ansible-doc --test validate-modules) ;;

View file

@ -67,6 +67,8 @@ cd "${TEST_DIR}"
# STAR: HACK install dependencies
retry ansible-galaxy -vvv collection install community.general
retry ansible-galaxy -vvv collection install ansible.netcommon
# retry ansible-galaxy -vvv collection install community.internal_test_tools - we need git checkout until 0.2.0 has been released
retry git clone https://github.com/ansible-collections/community.internal_test_tools.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/internal_test_tools"
retry pip install hcloud
# END: HACK