chore: update deploy script for VPS paths and PHP 8.4
Point APP_DIR at /home/hausdesign/preregister and run artisan/composer via explicit PHP and Composer binaries. Made-with: Cursor
This commit is contained in:
25
deploy.sh
25
deploy.sh
@@ -9,8 +9,9 @@ set -e
|
|||||||
# ./deploy.sh v1.2.0 → deploys specific tag
|
# ./deploy.sh v1.2.0 → deploys specific tag
|
||||||
# ──────────────────────────────────────────
|
# ──────────────────────────────────────────
|
||||||
|
|
||||||
# !! UPDATE THIS PATH TO YOUR VPS DIRECTORY !!
|
APP_DIR="/home/hausdesign/preregister"
|
||||||
APP_DIR="/home/hausdesign/domains/preregister.hausdesign.nl/public_html"
|
PHP="/usr/local/php84/bin/php"
|
||||||
|
COMPOSER="/usr/local/bin/composer"
|
||||||
TAG="${1:-}"
|
TAG="${1:-}"
|
||||||
|
|
||||||
echo "══════════════════════════════════════"
|
echo "══════════════════════════════════════"
|
||||||
@@ -21,7 +22,7 @@ cd "$APP_DIR"
|
|||||||
|
|
||||||
# 1. Maintenance mode
|
# 1. Maintenance mode
|
||||||
echo "→ Enabling maintenance mode..."
|
echo "→ Enabling maintenance mode..."
|
||||||
php artisan down --retry=30 || true
|
$PHP artisan down --retry=30 || true
|
||||||
|
|
||||||
# 2. Pull latest code
|
# 2. Pull latest code
|
||||||
echo "→ Pulling from Gitea..."
|
echo "→ Pulling from Gitea..."
|
||||||
@@ -38,7 +39,7 @@ fi
|
|||||||
|
|
||||||
# 3. Install PHP dependencies
|
# 3. Install PHP dependencies
|
||||||
echo "→ Installing Composer dependencies..."
|
echo "→ Installing Composer dependencies..."
|
||||||
composer install --no-dev --optimize-autoloader --no-interaction
|
$PHP $COMPOSER install --no-dev --optimize-autoloader --no-interaction
|
||||||
|
|
||||||
# 4. Install Node dependencies and build
|
# 4. Install Node dependencies and build
|
||||||
echo "→ Installing npm packages..."
|
echo "→ Installing npm packages..."
|
||||||
@@ -49,25 +50,25 @@ npm run build
|
|||||||
|
|
||||||
# 5. Run migrations
|
# 5. Run migrations
|
||||||
echo "→ Running migrations..."
|
echo "→ Running migrations..."
|
||||||
php artisan migrate --force
|
$PHP artisan migrate --force
|
||||||
|
|
||||||
# 6. Clear and rebuild caches
|
# 6. Clear and rebuild caches
|
||||||
echo "→ Clearing caches..."
|
echo "→ Clearing caches..."
|
||||||
php artisan config:cache
|
$PHP artisan config:cache
|
||||||
php artisan route:cache
|
$PHP artisan route:cache
|
||||||
php artisan view:cache
|
$PHP artisan view:cache
|
||||||
php artisan event:cache
|
$PHP artisan event:cache
|
||||||
|
|
||||||
# 7. Restart queue (process any pending jobs with new code)
|
# 7. Restart queue (process any pending jobs with new code)
|
||||||
echo "→ Restarting queue workers..."
|
echo "→ Restarting queue workers..."
|
||||||
php artisan queue:restart
|
$PHP artisan queue:restart
|
||||||
|
|
||||||
# 8. Storage link (idempotent)
|
# 8. Storage link (idempotent)
|
||||||
php artisan storage:link 2>/dev/null || true
|
$PHP artisan storage:link 2>/dev/null || true
|
||||||
|
|
||||||
# 9. Disable maintenance mode
|
# 9. Disable maintenance mode
|
||||||
echo "→ Going live!"
|
echo "→ Going live!"
|
||||||
php artisan up
|
$PHP artisan up
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "══════════════════════════════════════"
|
echo "══════════════════════════════════════"
|
||||||
|
|||||||
Reference in New Issue
Block a user