File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ set -ex # Exit immediately if a command exits with a non-zero status and print commands.
3+
24echo " Running composer"
3- composer install --no-dev --working-dir=/var/www/html
5+ # Attempt to clear composer cache first, then install
6+ composer clear-cache --working-dir=/var/www/html || echo " Failed to clear composer cache, continuing..."
7+ composer install --no-dev --no-interaction --no-progress --optimize-autoloader --working-dir=/var/www/html
8+
9+ echo " Checking for vendor/autoload.php..."
10+ if [ -f " /var/www/html/vendor/autoload.php" ]; then
11+ echo " vendor/autoload.php found."
12+ else
13+ echo " ERROR: vendor/autoload.php NOT found after composer install!"
14+ echo " Listing contents of /var/www/html/vendor/ if it exists:"
15+ ls -la /var/www/html/vendor/ || echo " /var/www/html/vendor/ directory does not exist."
16+ exit 1 # Exit if autoload is missing
17+ fi
418
519echo " Caching config..."
620php artisan config:cache
@@ -9,4 +23,6 @@ echo "Caching routes..."
923php artisan route:cache
1024
1125echo " Running migrations..."
12- php artisan migrate --force
26+ php artisan migrate --force
27+
28+ echo " Deployment script finished successfully."
You can’t perform that action at this time.
0 commit comments