Skip to content

Commit

Permalink
Added variable ansigenome_info.status which replaces beta.
Browse files Browse the repository at this point in the history
* This is more flexible.
* This PR also includes: #40

Usage examples:

* https://github.com/debops/ansible-mysql/pull/11
* https://github.com/debops/ansible-nat/pull/4
  • Loading branch information
ypid committed Jan 7, 2016
1 parent fa777cc commit a48a169
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ Here's the available variables you can use in your meta file or optional custom
# ansigenome_info fields.
galaxy_id : String based ID to find your role on the Galaxy
travis : Boolean to determine if this role is on Travis-CI
beta : Boolean to mark this role as Beta

status : Dictionary with info about the status
name : String, currently supported are: beta, deprecated
note : String containing additional information about the status

synopsis : String block containing what your role does
usage : String block containing a detailed usage guide
Expand Down Expand Up @@ -314,11 +317,17 @@ Available blocks to replace
---------------------------

- title
- ansigenome_managed
- badges
- status
- beta
- deprecated
- synopsis
- installation
- dependencies
- standalone
- defaults
- facts
- usage
- authors
- footer
Expand Down
18 changes: 16 additions & 2 deletions ansigenome/data/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@
{% if ansigenome_info.travis|d() %}[![Travis CI](http://img.shields.io/travis/{{ scm.user + '/' + role.slug }}.svg?style=flat)](http://travis-ci.org/{{ scm.user + '/' + role.slug }}){% endif %} {% if ansigenome_info.galaxy_id|d() %} [![Ansible Galaxy](http://img.shields.io/badge/galaxy-{{ role.galaxy_name | replace('-', '--')}}-660198.svg?style=flat)](https://galaxy.ansible.com/detail#/role/{{ ansigenome_info.galaxy_id }}){% endif %}{% if galaxy_info.platforms|d() %} [![Platforms](http://img.shields.io/badge/platforms-{{ galaxy_info.platforms | map(attribute='name') | sort | join('%20/%20') | lower }}-lightgrey.svg?style=flat)](#){% endif %}
{% endblock %}

{% if ansigenome_info.beta|d() %}
{% if ansigenome_info.status|d() is mapping or ansigenome_info.beta|d() %}
{% block status %}
{# Consider using the `ansigenome_info.status` instead of `ansigenome_info.beta` #}

{% if ansigenome_info.status|d() and ansigenome_info.status.name|d('beta') == 'deprecated' %}
{% block deprecated %}
### Warning, this is a deprecated role
{% endblock %}
{% elif ansigenome_info.beta|d() or ansigenome_info.status.name|d('beta') == 'beta' %}
{% block beta %}
### Warning, this is a BETA role
### Warning, this is a Beta role

This role has been marked by the author as a beta role, which means that it
might be significantly changed in the future. Be careful while using this role
in a production environment.
{% endblock %}
{% endif %}
{% if ansigenome_info.status|d() and ansigenome_info.status.note|d('') %}

{{ ansigenome_info.status.note }}
{% endif %}

***
{% endblock %}
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ def test_templates(self):
self.assertIn("ansigenome", readme)
self.assertIn("galaxy.ansible.com", readme)
self.assertNotIn("BETA", readme)
self.assertNotIn("beta", readme)
self.assertNotIn("deprecated", readme)
self.assertNotIn("galaxy-install", readme)
self.assertNotIn("twitter", readme)

0 comments on commit a48a169

Please sign in to comment.