fix(ci): switch deploy strategy from rsync-to-/current/ to git pull o… - #56
Conversation
…n VPS Root cause of CI/CD failures: the pipeline rsynced code to a new /current/ subdirectory that the existing systemd service and /deploy bot command don't know about, so restarts continued running old code and post-deploy checks probed the wrong paths. Fix: mirror the working /deploy bot command — SSH to VPS and run git fetch origin main + git reset --hard origin/main in the flat /var/www/html/Runewager/ directory that the service already uses. Changes: - deploy.yml: replace archive+rsync steps with git pull approach; save pre-deploy SHA for git-based rollback on failure; remove dead dry-run guard; update all /current/ paths to flat path; rollback now does git reset --hard <pre_sha> + npm ci + restart - runewager.service: revert all paths from /current/ back to flat /var/www/html/Runewager/ (service must match deploy target) - post-deploy-verify.sh: update DEPLOY_DIR default to flat path https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN
|
CodeAnt AI is reviewing your PR. |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe deployment pipeline is refactored from an archive-rsync approach to git-based updates on the VPS. The directory structure shifts from a Changes
Sequence DiagramsequenceDiagram
actor User
participant Workflow as GitHub<br/>Workflow
participant VPS as VPS Server
participant Git as Git Repository
participant Service as Runewager<br/>Service
participant Tests as Smoke Tests
participant Slack as Notifications
User->>Workflow: Trigger manual deploy
Workflow->>VPS: Connect via SSH
VPS->>VPS: Capture pre-deploy SHA (PRE_SHA)
Workflow->>VPS: Deploy code: git fetch origin main
VPS->>Git: Fetch latest
VPS->>VPS: git reset --hard origin/main
Workflow->>VPS: Copy .env and config
Workflow->>VPS: npm ci
Workflow->>VPS: Restart service
VPS->>Service: Systemctl restart
Workflow->>Tests: Run smoke tests
alt Tests Pass
Workflow->>VPS: Write .release_info
Workflow->>Slack: Send success notification
else Tests Fail
Workflow->>VPS: Check if PRE_SHA available
alt PRE_SHA Found
VPS->>Git: git reset --hard PRE_SHA
VPS->>Service: Restart service
Workflow->>Slack: Notify rollback completed
else PRE_SHA Not Found
Workflow->>Slack: Notify rollback unavailable
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
User description
…n VPS
Root cause of CI/CD failures: the pipeline rsynced code to a new /current/ subdirectory that the existing systemd service and /deploy bot command don't know about, so restarts continued running old code and post-deploy checks probed the wrong paths.
Fix: mirror the working /deploy bot command — SSH to VPS and run
git fetch origin main + git reset --hard origin/main
in the flat /var/www/html/Runewager/ directory that the service already uses.
Changes:
https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN
CodeAnt-AI Description
Switch production deploy to git pull and target the service's actual install directory
What Changed
Impact
✅ Fewer failed CI deploys due to stale service paths✅ Fewer stale running versions after deploy✅ Clearer, automated git rollback with notification💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit