summaryrefslogtreecommitdiffstats
path: root/integrations/gen_docs_integrations.py
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/gen_docs_integrations.py')
-rw-r--r--integrations/gen_docs_integrations.py39
1 files changed, 18 insertions, 21 deletions
diff --git a/integrations/gen_docs_integrations.py b/integrations/gen_docs_integrations.py
index 2b27db859..caceb9cc9 100644
--- a/integrations/gen_docs_integrations.py
+++ b/integrations/gen_docs_integrations.py
@@ -5,29 +5,26 @@ import re
# Dictionary responsible for making the symbolic links at the end of the script's run.
symlink_dict = {}
-am_i_inside_go = "go.d.plugin" in str(Path.cwd())
def cleanup():
"""
clean directories that are either data collection or exporting integrations
"""
- if am_i_inside_go:
- for element in Path("modules").glob('**/*/'):
- if "integrations" in str(element):
- shutil.rmtree(element)
- else:
- for element in Path("collectors").glob('**/*/'):
- if "integrations" in str(element):
- shutil.rmtree(element)
-
- for element in Path("exporting").glob('**/*/'):
- if "integrations" in str(element):
- shutil.rmtree(element)
- for element in Path("integrations/cloud-notifications").glob('**/*/'):
- if "integrations" in str(element) and not "metadata.yaml" in str(element):
- shutil.rmtree(element)
-
+ for element in Path("src/go/collectors/go.d.plugin/modules").glob('**/*/'):
+ if "integrations" in str(element):
+ shutil.rmtree(element)
+ for element in Path("src/collectors").glob('**/*/'):
+ # print(element)
+ if "integrations" in str(element):
+ shutil.rmtree(element)
+
+ for element in Path("src/exporting").glob('**/*/'):
+ if "integrations" in str(element):
+ shutil.rmtree(element)
+ for element in Path("integrations/cloud-notifications").glob('**/*/'):
+ if "integrations" in str(element) and not "metadata.yaml" in str(element):
+ shutil.rmtree(element)
def generate_category_from_name(category_fragment, category_array):
"""
@@ -145,7 +142,7 @@ def build_readme_from_integration(integration, mode=''):
meta_yaml = integration['edit_link'].replace("blob", "edit")
sidebar_label = integration['meta']['monitored_instance']['name']
learn_rel_path = generate_category_from_name(
- integration['meta']['monitored_instance']['categories'][0].split("."), categories)
+ integration['meta']['monitored_instance']['categories'][0].split("."), categories).replace("Data Collection", "Collecting Metrics")
most_popular = integration['meta']['most_popular']
# build the markdown string
@@ -197,7 +194,7 @@ endmeta-->
meta_yaml: "{meta_yaml}"
sidebar_label: "{sidebar_label}"
learn_status: "Published"
-learn_rel_path: "Exporting"
+learn_rel_path: "Exporting Metrics"
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE EXPORTER'S metadata.yaml FILE"
endmeta-->
@@ -229,7 +226,7 @@ endmeta-->
meta_yaml: "{meta_yaml}"
sidebar_label: "{sidebar_label}"
learn_status: "Published"
-learn_rel_path: "{learn_rel_path.replace("notifications", "Alerting/Notifications")}"
+learn_rel_path: "{learn_rel_path.replace("notifications", "Alerts & Notifications/Notifications")}"
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE"
endmeta-->
@@ -367,7 +364,7 @@ for integration in integrations:
path = build_path(meta_yaml)
write_to_file(path, md, meta_yaml, sidebar_label, community)
- elif not am_i_inside_go:
+ else:
# kind of specific if clause, so we can avoid running excessive code in the go repo
if integration['integration_type'] == "exporter":