42 lines
931 B
Bash
42 lines
931 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
echo "Starting Cachet initialization..."
|
|
|
|
cd /var/www/html
|
|
|
|
if [ ! -f ".env" ]; then
|
|
echo "Creating .env file from .env.example..."
|
|
cp .env.example .env
|
|
fi
|
|
|
|
if [ -z "$APP_KEY" ] || [ "$APP_KEY" = "" ]; then
|
|
echo "Generating application key..."
|
|
php artisan key:generate --force
|
|
fi
|
|
|
|
echo "Caching configuration..."
|
|
php artisan config:cache
|
|
php artisan route:cache
|
|
php artisan view:cache
|
|
|
|
echo "Publishing Cachet assets..."
|
|
php artisan vendor:publish --tag=cachet --force
|
|
|
|
echo "Publishing Filament assets..."
|
|
php artisan filament:assets
|
|
|
|
echo "Running database migrations..."
|
|
php artisan migrate --force
|
|
|
|
echo "Creating storage symlink..."
|
|
php artisan storage:link || true
|
|
|
|
echo "Setting permissions..."
|
|
chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
|
chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
echo "Cachet initialization complete!"
|
|
|
|
exec "$@"
|