Improve docs pipeline with generated topology diagrams
This commit is contained in:
@@ -20,27 +20,50 @@ def sanitize_text(content: str) -> str:
|
||||
content = re.sub(r'(?m)^([A-Z0-9_]*(?:PASSWORD|TOKEN|API_KEY|SECRET)[A-Z0-9_]*)\s*[:=]\s*.*$', r'\1=<redacted>', content)
|
||||
return content
|
||||
|
||||
|
||||
for name in ['compose-inventory.md', 'traefik-routes.md', 'prometheus-rules.md']:
|
||||
src = src_generated / name
|
||||
if src.exists():
|
||||
(out_dir / name).write_text(sanitize_text(src.read_text(errors='ignore')))
|
||||
|
||||
svg_src = src_diagrams / 'docker-compose.svg'
|
||||
if svg_src.exists():
|
||||
(out_dir / 'docker-compose.svg').write_text(sanitize_text(svg_src.read_text(errors='ignore')))
|
||||
for svg_name in ['docker-compose.svg', 'physical-topology.svg', 'docker-traefik-dynu.svg']:
|
||||
src = src_diagrams / svg_name
|
||||
if src.exists():
|
||||
(out_dir / svg_name).write_text(sanitize_text(src.read_text(errors='ignore')))
|
||||
|
||||
(out_dir / 'index.md').write_text(
|
||||
"""# Public Infrastructure Summary
|
||||
|
||||
This folder contains sanitized documentation generated from the infrastructure repository.
|
||||
This documentation is generated from the infrastructure repository. Sensitive values are redacted.
|
||||
|
||||
Sensitive values such as internal domain names, private IP addresses, tokens, passwords, and secrets are redacted.
|
||||
## Infrastructure diagrams
|
||||
|
||||
### Physical / virtual topology
|
||||
|
||||

|
||||
|
||||
### Docker, Traefik and Dynu routing
|
||||
|
||||

|
||||
|
||||
## Documents
|
||||
|
||||
- [Diagrams](diagrams.md)
|
||||
- [Compose Inventory](compose-inventory.md)
|
||||
- [Traefik Routes](traefik-routes.md)
|
||||
- [Prometheus Rules](prometheus-rules.md)
|
||||
- [Docker Compose Diagram](docker-compose.svg)
|
||||
"""
|
||||
)
|
||||
|
||||
(out_dir / 'diagrams.md').write_text(
|
||||
"""# Infrastructure diagrams
|
||||
|
||||
## Physical / virtual topology
|
||||
|
||||

|
||||
|
||||
## Docker, Traefik and Dynu routing
|
||||
|
||||

|
||||
"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user