From 63474845f871a1330c4ad207e095f85674813f0c Mon Sep 17 00:00:00 2001 From: tegwick Date: Fri, 27 Mar 2026 02:26:34 +0100 Subject: [PATCH] fix(e2e-cron-install): rsync repo before installing cron If the repo doesn't exist on the sandbox host, the chmod fails. Now e2e-cron-install rsyncs the repo first (same mechanism as make e2e), then installs the cron entry. run-on-host.sh uses git pull for subsequent updates. Co-Authored-By: Claude Sonnet 4.6 --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cba90b9..8e43ead 100644 --- a/Makefile +++ b/Makefile @@ -127,10 +127,20 @@ RAILIANCE_SSH := ssh -i "$(RAILIANCE_KEY)" -o StrictHostKeyChecking=no $(RAILI .PHONY: e2e-cron-install e2e-cron-install: @test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1) - $(eval REMOTE_REPO := /home/$(RAILIANCE_USER)/$(REPO)) - $(eval CRON_CMD := $(REMOTE_REPO)/e2e/run-on-host.sh >> /var/log/$(REPO)-e2e.log 2>&1) - $(eval CRON_LINE := 13 3 * * 0 $(CRON_CMD)) - @echo "Installing cron on $(RAILIANCE_USER)@$(RAILIANCE_HOST) for $(REPO)..." + $(eval REPO_PATH := $(HOME)/$(REPO)) + $(eval REMOTE_REPO := /home/$(RAILIANCE_USER)/$(REPO)) + $(eval CRON_CMD := $(REMOTE_REPO)/e2e/run-on-host.sh >> /var/log/$(REPO)-e2e.log 2>&1) + $(eval CRON_LINE := 13 3 * * 0 $(CRON_CMD)) + @test -d "$(REPO_PATH)" || (echo "ERROR: local repo not found: $(REPO_PATH)"; exit 1) + @test -f "$(REPO_PATH)/e2e/run-on-host.sh" || (echo "ERROR: no e2e/run-on-host.sh in $(REPO_PATH)"; exit 1) + @echo "--- syncing $(REPO) to $(RAILIANCE_USER)@$(RAILIANCE_HOST):$(REMOTE_REPO)" + @rsync -az --delete \ + --exclude=.git --exclude=__pycache__ --exclude='*.pyc' \ + --exclude=.venv --exclude=node_modules \ + -e "ssh -i $(RAILIANCE_KEY) -o StrictHostKeyChecking=no" \ + "$(REPO_PATH)/" \ + "$(RAILIANCE_USER)@$(RAILIANCE_HOST):$(REMOTE_REPO)/" + @echo "--- installing cron on $(RAILIANCE_USER)@$(RAILIANCE_HOST) for $(REPO)" @$(RAILIANCE_SSH) "chmod +x $(REMOTE_REPO)/e2e/run-on-host.sh && \ ( crontab -l 2>/dev/null | grep -v '$(REPO)-e2e' ; echo '$(CRON_LINE)' ) | crontab - && \ echo 'Cron installed:' && crontab -l | grep '$(REPO)-e2e'"