Skip to content

Commit 44ee457

Browse files
authored
Merge pull request #1213 from w3bdesign/dev
Update deploy.sh
2 parents 7a10931 + 67e7787 commit 44ee457

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

deploy.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
#!/usr/bin/env bash
2+
set -ex # Exit immediately if a command exits with a non-zero status and print commands.
3+
24
echo "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

519
echo "Caching config..."
620
php artisan config:cache
@@ -9,4 +23,6 @@ echo "Caching routes..."
923
php artisan route:cache
1024

1125
echo "Running migrations..."
12-
php artisan migrate --force
26+
php artisan migrate --force
27+
28+
echo "Deployment script finished successfully."

0 commit comments

Comments
 (0)