Debug
This commit is contained in:
parent
00dc7c0f10
commit
f95a7075c7
@ -1,5 +1,6 @@
|
||||
import os
|
||||
import yaml
|
||||
import glob
|
||||
import subprocess
|
||||
|
||||
# 🔁 Repos to scan for monitoring.yaml files
|
||||
@ -34,10 +35,8 @@ def extract_urls():
|
||||
manifests_path = os.path.join(BASE_DIR, repo, "manifests")
|
||||
if not os.path.isdir(manifests_path):
|
||||
continue
|
||||
for app in os.listdir(manifests_path):
|
||||
path = os.path.join(manifests_path, app, "monitoring.yaml")
|
||||
if not os.path.exists(path):
|
||||
continue
|
||||
# recursively find all monitoring.yaml
|
||||
for path in glob.glob(f"{manifests_path}/**/monitoring.yaml", recursive=True):
|
||||
with open(path) as f:
|
||||
cfg = yaml.safe_load(f)
|
||||
if not cfg.get("enabled"):
|
||||
@ -45,7 +44,7 @@ def extract_urls():
|
||||
ext = cfg.get("external_check")
|
||||
if not ext or not ext.get("url"):
|
||||
continue
|
||||
app_name = cfg.get("app", app)
|
||||
app_name = cfg.get("app") or os.path.basename(os.path.dirname(path))
|
||||
urls.append({
|
||||
"name": app_name,
|
||||
"url": ext["url"]
|
||||
@ -53,6 +52,7 @@ def extract_urls():
|
||||
return urls
|
||||
|
||||
|
||||
|
||||
def generate_workflow(urls):
|
||||
os.makedirs(os.path.dirname(WORKFLOW_FILE), exist_ok=True)
|
||||
with open(WORKFLOW_FILE, "w") as f:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user