diff --git a/bin/infra-net b/bin/infra-net index 586195e..9acfbbe 100755 --- a/bin/infra-net +++ b/bin/infra-net @@ -25,10 +25,10 @@ OUT = os.path.join(NET_TOOLS, "data", "infra-net.json") # Where deployable projects live (each may carry a root .infra.yaml). ROOTS = [ - os.path.join(CODE, "@applications", "*", ".infra.yaml"), - os.path.join(CODE, "@projects", "@cocottetech", "@platform", "codebase", "@features", "*", ".infra.yaml"), - os.path.join(CODE, "@projects", "@cocottetech", ".infra.yaml"), - os.path.join(CODE, "@projects", "@magic-civilization", ".infra.yaml"), + os.path.join(CODE, "@applications", "*", ".infra*.yaml"), + os.path.join(CODE, "@projects", "@cocottetech", "@platform", "codebase", "@features", "*", ".infra*.yaml"), + os.path.join(CODE, "@projects", "@cocottetech", ".infra*.yaml"), + os.path.join(CODE, "@projects", "@magic-civilization", ".infra*.yaml"), ] @@ -76,6 +76,7 @@ def main() -> int: db = m.get("database", {}) or {} rows.append({ "project": m["project"], + "environment": m.get("environment", "prod"), "provider": m.get("provider"), "host": host, "port": port, @@ -87,11 +88,11 @@ def main() -> int: rows.sort(key=lambda r: (r["host"] or "~", r["port"] or 0)) w = max([len(r["project"]) for r in rows] + [7]) print(f"\n infra-net — {len(rows)} services across {len(hosts)} hosts\n") - print(f" {'PROJECT'.ljust(w)} {'HOST'.ljust(8)} {'PORT'.ljust(5)} {'PROVIDER'.ljust(12)} DB / DEPS") + print(f" {'PROJECT'.ljust(w)} {'ENV'.ljust(4)} {'HOST'.ljust(8)} {'PORT'.ljust(5)} {'PROVIDER'.ljust(12)} DB / DEPS") for r in rows: deps = (" deps:" + ",".join(r["depends_on"])) if r["depends_on"] else "" dbp = (r["db"] or "") + deps - print(f" {r['project'].ljust(w)} {str(r['host']).ljust(8)} {str(r['port'] or '').ljust(5)} {str(r['provider']).ljust(12)} {dbp}") + print(f" {r['project'].ljust(w)} {str(r['environment']).ljust(4)} {str(r['host']).ljust(8)} {str(r['port'] or '').ljust(5)} {str(r['provider']).ljust(12)} {dbp}") if problems: print("\n PROBLEMS:")