Skip to content

Commit

Permalink
feat: bump with OpenTofu registry links
Browse files Browse the repository at this point in the history
  • Loading branch information
Shr3ps committed Nov 28, 2024
1 parent 50562e0 commit a52dedb
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 85 deletions.
4 changes: 4 additions & 0 deletions scripts/gen_github_repo_md_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def _get_tfregistry_url(proj_name):
return proj_url
return None

def _get_tofu_registry_url(proj_name):
return 'https://search.opentofu.org/module/claranet/{}/azurerm/latest'.format(proj_name)


def gather_repos(organization, no_forks=True):
all_repos = gh.repositories_by(organization)
Expand All @@ -40,6 +43,7 @@ def gather_repos(organization, no_forks=True):

def render_tpl(repo):
repo['registry'] = _get_tfregistry_url(repo['name'].replace('terraform-aws-', '').replace('terraform-azurerm-', ''))
repo['registrytofu'] = _get_tofu_registry_url(repo['name'].replace('terraform-aws-', '').replace('terraform-azurerm-', ''))

file_loader = FileSystemLoader('templates')
env = Environment(loader=file_loader)
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/md_tpl.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## {{ repo.name }}
[![github](https://img.shields.io/badge/source-github-black.svg?style=flat-square&logo=github)]({{ repo.url }}) {% if repo.registry: %}[![registry](https://img.shields.io/badge/terraform-registry-623CE4.svg?style=flat-square&logo=terraform)]({{ repo.registry }}){% endif %}
[![github](https://img.shields.io/badge/source-github-black.svg?style=flat-square&logo=github)]({{ repo.url }}) {% if repo.registry: %}[![registry](https://img.shields.io/badge/terraform-registry-623CE4.svg?style=flat-square&logo=terraform)]({{ repo.registry }}) [![open tofu](https://img.shields.io/badge/opentofu-registry-yellow.svg?style=flat-square&logo=opentofu)]({{ repo.registrytofu }}){% endif %}
{% if repo.is_fork: %}
Fork of the `{{ repo.name }}` module with Claranet's contributions and improvements.
{% else %}
Expand Down
8 changes: 8 additions & 0 deletions scripts/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dev quick start

```bash
rm -rf venv && virtualenv venv
source ./venv/bin/activate
pip install -r requirements.txt
rm -v ../tf-modules-azure.md ; python gen_github_repo_md_list.py > ../tf-modules-azure.md
```
Loading

0 comments on commit a52dedb

Please sign in to comment.