Skip to content

Update deploy.sh #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/usr/bin/env bash
set -ex # Exit immediately if a command exits with a non-zero status and print commands.

echo "Running composer"
composer install --no-dev --working-dir=/var/www/html
# Attempt to clear composer cache first, then install
composer clear-cache --working-dir=/var/www/html || echo "Failed to clear composer cache, continuing..."
composer install --no-dev --no-interaction --no-progress --optimize-autoloader --working-dir=/var/www/html

echo "Checking for vendor/autoload.php..."
if [ -f "/var/www/html/vendor/autoload.php" ]; then
echo "vendor/autoload.php found."
else
echo "ERROR: vendor/autoload.php NOT found after composer install!"
echo "Listing contents of /var/www/html/vendor/ if it exists:"
ls -la /var/www/html/vendor/ || echo "/var/www/html/vendor/ directory does not exist."
exit 1 # Exit if autoload is missing
fi

echo "Caching config..."
php artisan config:cache
Expand All @@ -9,4 +23,6 @@ echo "Caching routes..."
php artisan route:cache

echo "Running migrations..."
php artisan migrate --force
php artisan migrate --force

echo "Deployment script finished successfully."