Allow deploy user to switch current release symlink.
Deploy Ladill QR Plus / deploy (push) Successful in 20s

Fall back to passwordless sudo when the app root is not writable by the runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-06 21:47:09 +00:00
co-authored by Cursor
parent 2faa10b54c
commit ee3ec495bb
+14 -1
View File
@@ -191,8 +191,21 @@ if ! run_artisan "migrate --force"; then
exit 1
fi
switch_current_release() {
if ln -sfnT "$NEW_RELEASE" "$CURRENT_LINK" 2>/dev/null; then
return 0
fi
if command -v sudo >/dev/null 2>&1 && sudo -n ln -sfnT "$NEW_RELEASE" "$CURRENT_LINK"; then
return 0
fi
echo "Unable to update current release symlink at $CURRENT_LINK" >&2
return 1
}
log "Switching current release"
ln -sfnT "$NEW_RELEASE" "$CURRENT_LINK"
switch_current_release
log "Optimizing Laravel"
if [ -L "$CURRENT_LINK" ] && [ -f "$CURRENT_LINK/artisan" ]; then