File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
+ set -ex # Exit immediately if a command exits with a non-zero status and print commands.
3
+
2
4
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
4
18
5
19
echo " Caching config..."
6
20
php artisan config:cache
@@ -9,4 +23,6 @@ echo "Caching routes..."
9
23
php artisan route:cache
10
24
11
25
echo " 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