File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -11,20 +11,27 @@ phases:
1111
1212 pre_build :
1313 commands :
14- - echo Setting Laravel permissions...
15- - cp .env.example .env
16- - php artisan config:clear
17- - php artisan cache:clear
18- - php artisan config:cache
19- - php artisan route:cache
20- - php artisan view:cache
14+ - echo "🔧 Preparing Laravel environment..."
15+
16+ # Check if .env.production exists, then copy it
17+ - if [ -f .env.production ]; then cp .env.production .env; else cp .env.example .env; fi
18+
19+ # (Optional) Create SQLite file if using SQLite
20+ - if grep -q "DB_CONNECTION=sqlite" .env; then touch database/database.sqlite; fi
21+
22+ - echo "🧪 Running Laravel migrations..."
23+ - php artisan migrate --force
24+
25+ # Laravel Cache Optimization
26+ - php artisan optimize
2127
2228 build :
2329 commands :
24- - echo Running Laravel Tests...
30+ - echo "🧪 Running Laravel Tests..."
2531 - php artisan test || true # You can fail the build if test fails
26- - echo Build completed.
32+
33+ - echo "✅ Build completed."
2734
2835 post_build :
2936 commands :
30- - echo Deployment ready! Triggering post-deployment hook...
37+ - echo "🚀 Deployment ready! Triggering post-deployment hook..."
You can’t perform that action at this time.
0 commit comments