docs: make compose inventory generation deterministic
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Docker Compose Inventory
|
# Docker Compose Inventory
|
||||||
|
|
||||||
Generated: 2026-05-12T22:04:13Z
|
Source fingerprint: `d6aa78e3317a`
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Docker Compose Inventory
|
# Docker Compose Inventory
|
||||||
|
|
||||||
Generated: 2026-05-12T22:04:13Z
|
Source fingerprint: `d6aa78e3317a`
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import hashlib
|
||||||
import sys, yaml
|
import sys, yaml
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
|
||||||
def md(v): return str(v).replace('|','\\|') if v is not None else ''
|
def md(v): return str(v).replace('|','\\|') if v is not None else ''
|
||||||
|
|
||||||
@@ -9,7 +9,9 @@ with open(inp) as f: c=yaml.safe_load(f) or {}
|
|||||||
svcs=c.get('services',{}) or {}
|
svcs=c.get('services',{}) or {}
|
||||||
nets=c.get('networks',{}) or {}
|
nets=c.get('networks',{}) or {}
|
||||||
vols=c.get('volumes',{}) or {}
|
vols=c.get('volumes',{}) or {}
|
||||||
lines=["# Docker Compose Inventory","",f"Generated: {datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')}","","## Summary","","| Item | Count |","|---|---:|",f"| Services | {len(svcs)} |",f"| Networks | {len(nets)} |",f"| Volumes | {len(vols)} |","","## Services","","| Service | Container | Image | Build | Profiles | Networks | Ports | Restart |","|---|---|---|---|---|---|---|---|"]
|
raw=open(inp,'rb').read()
|
||||||
|
fingerprint=hashlib.sha256(raw).hexdigest()[:12]
|
||||||
|
lines=["# Docker Compose Inventory","",f"Source fingerprint: `{fingerprint}`","","## Summary","","| Item | Count |","|---|---:|",f"| Services | {len(svcs)} |",f"| Networks | {len(nets)} |",f"| Volumes | {len(vols)} |","","## Services","","| Service | Container | Image | Build | Profiles | Networks | Ports | Restart |","|---|---|---|---|---|---|---|---|"]
|
||||||
for n,s in sorted(svcs.items()):
|
for n,s in sorted(svcs.items()):
|
||||||
build=s.get('build','')
|
build=s.get('build','')
|
||||||
if isinstance(build,dict): build=build.get('context','')
|
if isinstance(build,dict): build=build.get('context','')
|
||||||
|
|||||||
Reference in New Issue
Block a user