Allow deploy user to switch current release symlink.
Deploy Ladill QR Plus / deploy (push) Successful in 20s
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:
+14
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user