Move scripts: stop by project, so a pulled clone works #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "change/move-scripts-pulled"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changes
docs/guides/move-vps.shdocker compose -p <project> down, run from/, with no file and no-v. This works whether or not the clone is pulled, and covers overleaf and mywebsite (projectmysite). It first probes thatdocker compose -p … psworks without a file, and stops if it doesn't./root/move-vps-running-before, written once,<stack> <project>). Step 5 starts only those, in the same order, and lists the ones it leaves stopped (today: actual, grafana, stirling-pdf, uptime-kuma, wallos, wud). mywebsite starts withdocker compose -p <its project> up -dwhen it has a compose file; otherwise the user is told to start it. If nothing runs from the clone, it stops, because step 5 wouldn't know what to start.ente_postgres-datamount check moves before the stop. The separate-f old-compose.yaml downis dropped, since the project stop covers it.old-compose.yamland the copy are as before.docs/guides/move-nixos.sh: after the file loop, whatever still runs from the old directories is stopped by project ifpodman compose -p … psworks from/. Otherwise the script stops before stopping anything and says to stop those projects by hand.Check. Run against scratch clones with stateful stubs of
docker/podman/id/sudo/curl(the stub'spsreports containers in the old dirs;compose -p X downremoves them;upadds them under the new dir):origin/main:--dry-runchanges nothing. The full run stops all 11 projects from/, copies ente, leaves no untracked state outsidevps/except the oldente/(kept on purpose), starts the 8 recorded stacks, overleaf (bin/up), ente's copy andmysiteinvps/mywebsite, and lists the 6 it left stopped. A re-run stops nothing and starts the same set.3f0e6da(not pulled): it pulls toorigin/main, moves the state and starts what ran.STOPPEDbefore stopping anything./and the state moves. Step 5 then stops atnixos/plane/compose.sh's own "not the NixOS host" guard; this PR doesn't change it.shellcheck -e SC2015is clean on both scripts.After the merge: on the VPS,
cd /srv/selfhosted && git pull, thengit show origin/main:docs/guides/move-vps.sh > /root/move-vps.sh,bash /root/move-vps.sh --dry-runandbash /root/move-vps.sh. Nothing to deploy otherwise.Rules this PR removes or rewrites:
origin/main, which works whether or not the clone is pulled". The guide also gains "the manual steps assume the clone isn't pulled".move-vps.shstep 5 used to start every stack; it now starts only the ones that ran before and lists the rest.move-nixos.shstill starts all four.move-vps.shused to stop each stack by its old compose file, overleaf withbin/docker-compose downand the old ente with-f old-compose.yaml down. It now stops each project, and stops before stopping anything when a stack it doesn't know runs from the clone.mywebsite/. "Start vps/mywebsite the way you run it" is printed only when the script didn't start it.🤖 Generated with Claude Code
Local review round (two reviewer subagents: correctness, methodology).
Correctness (verdict: with fixes):
move-vps.shstep 2/5: a project under the clone that the script doesn't know (a retired stack still running, e.g. seafile) is stopped and then neither started nor reported.ente_postgres-datavolume check runs after step 2 has stopped everything.mktempleaves a file on every first run, dry or real.move-nixos.sh: the dry run skips the podman probe, so it passes where the real run would stop.Methodology (verdict: fix 7 and 8, then merge):
7. Important, guide The scripts: "start again only the stacks that ran before" is wrong for
move-nixos.sh, which starts all four.8. Important, PR body: Rules this PR removes or rewrites is incomplete.
9. Minor:
move-vps.sh's header still says "starts everything again".10. Minor, guide: "stop each compose project" holds on NixOS only if podman compose can stop one without its file.
11. Minor, guide: "or read from the clone" gives no command.
12. Minor: no closing handoff yet.
Checks: the repo's Setup check command: exit 0.
shellcheck -e SC2015 docs/guides/move-*.sh: exit 0.python3 .methodology/shared/sync-agents.py --check: exit 0.Replies to the review round, all in
7f89151unless noted:seafileproject.WARNINGwhen ente ran but has no copy to start.git show origin/main:works whether or not the clone is pulled.main.WIP: Move scripts: stop by project, so a pulled clone worksto Move scripts: stop by project, so a pulled clone works