fix: unicorn-auto-deploy-advanced — resolve PM2 "script not found" by targeting UNICORN_FINAL as app dir#162
Merged
Conversation
…2 process name Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/72c22feb-b3f6-46ee-9cfe-eb198edaaae5 Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ruffy80
April 14, 2026 07:12
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Deploy to Hetzner with rollback" step was failing in 4s with
[PM2][ERROR] Script not found: ***/src/index.js. The SSH deploy script rannpm install, PM2, and health checks from the git repo root (/opt/unicorn) — but the app lives inUNICORN_FINAL/subdirectory.ecosystem.config.js,backend/index.js, andclient/are all one level deeper, so every app operation was resolving against the wrong path.Changes
APP_DIRdetection: aftergit pullinREPO_DIR, deriveAPP_DIRas$REPO_DIR/UNICORN_FINALwhen that subdir exists, falling back to$REPO_DIRfor servers where the deploy path already points directly at the app:APP_DIR=$([ -d "$REPO_DIR/UNICORN_FINAL" ] && echo "$REPO_DIR/UNICORN_FINAL" || echo "$REPO_DIR")cd "$APP_DIR"instead of running from the git rootunicorn-backend→unicornto match the name defined inecosystem.config.jspm2 start:src/index.js --name unicorn-backend→backend/index.js --name unicorngit resetstill runs inREPO_DIR, then re-cds intoAPP_DIRbefore npm install and PM2