[DEPLOY] CT103: promtail под compose, постоянные позиции; предохранитель в генераторе
lint / hygiene (push) Successful in 15s

This commit is contained in:
root committed 2026-10-28 13:18:33 +03:00
1 parent 4622c02040
commit 1b476e2dd8
26 files changed
+95 -22

No files matched your search

+8
View File
@@ -107,6 +107,11 @@ def build(ct):
if cfg.get("Command"):
svc["command"] = cfg["Command"]
elif "promtail" in cfg["Image"]:
# promtail без явного -config.file берёт встроенный конфиг образа
# (в нём нет clients) и падает: "at least one client config must be provided".
# Проверено 28.10.2026 на CT103.
svc["command"] = ["-config.file=/etc/promtail/config.yml"]
if cfg.get("Entrypoint"):
svc["entrypoint"] = cfg["Entrypoint"]
for n in svc.get("networks", []):
@@ -168,6 +173,9 @@ def main():
if write:
d = f"{REPO}/deploy/ct{ct}"
os.makedirs(d, exist_ok=True)
if os.path.exists(f"{d}/docker-compose.yml") and "--force" not in sys.argv:
print(f"CT{ct}: файл уже есть, не перезаписываю (--force чтобы обновить)", file=sys.stderr)
return 0
open(f"{d}/docker-compose.yml", "w", encoding="utf-8").write(body)
with open(f"{d}/env.example", "w", encoding="utf-8") as f:
f.write("# Скопировать в .env на CT%s, chmod 600\n" % ct)