8dab40c7a7
gates / gates (push) Successful in 27s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
34 lines
1.8 KiB
Python
34 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
"""What an INSTALLED app gets when the catalog changes only a SETTING (R-752): wger installed from the drill
|
|
(AXES_COOLOFF_TIME=5); then a drill-only commit sets 6; sync + rescan; read the stack-dir compose and the RUNNING
|
|
container's env; press the app page's Restart (POST /api/stacks/wger/restart); read the env again. Removed after."""
|
|
import subprocess, time
|
|
import walk as w
|
|
import lk
|
|
|
|
D = "/mnt/5_hdd/felhom.eu/drill/app-catalog-drill"
|
|
ENV = "docker inspect wger --format '{{range .Config.Env}}{{println .}}{{end}}' | grep AXES_COOLOFF; docker inspect wger --format 'container created {{.Created}}'"
|
|
FILE = "grep -h AXES_COOLOFF /opt/docker/stacks/wger/docker-compose.yml"
|
|
w.login()
|
|
lk.p("deploy:", w.deploy("wger", "fitness"))
|
|
time.sleep(20)
|
|
lk.p("running env:", w.guest(ENV).strip().replace("\n", " | "))
|
|
r = subprocess.run(["bash", "-c", f"cd {D} && sed -i 's/^ - AXES_COOLOFF_TIME=5$/ - AXES_COOLOFF_TIME=6/' templates/wger/docker-compose.yml && "
|
|
"git commit -qam 'DRILL wger: cool-off 6 (installed-app probe)' && git push -q origin main 2>&1 | grep -v ^remote; git log --oneline -1"],
|
|
capture_output=True, text=True)
|
|
lk.p("drill:", r.stdout.strip(), r.stderr.strip()[-200:])
|
|
t0 = time.time()
|
|
for _ in range(20):
|
|
w.sync_rescan()
|
|
f = w.guest(FILE).strip()
|
|
if "=6" in f:
|
|
break
|
|
time.sleep(15)
|
|
lk.p(f"stack-dir compose after {(time.time() - t0):.0f} s of sync rounds:", f)
|
|
lk.p("running env (no action yet):", w.guest(ENV).strip().replace("\n", " | "))
|
|
lk.p("press Restart:", w.ctl("POST", "/api/stacks/wger/restart"))
|
|
time.sleep(30)
|
|
lk.p("running env after Restart:", w.guest(ENV).strip().replace("\n", " | "))
|
|
w.remove("wger")
|
|
lk.p("removed; deployed =", w.stack("wger").get("deployed"))
|