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 <noreply@anthropic.com>
This commit is contained in:
18
Makefile
18
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'"
|
||||
|
||||
Reference in New Issue
Block a user