@@ -3,45 +3,54 @@ version: 0.2
33phases :
44 install :
55 runtime-versions :
6- php : 8.3
6+ php : 8.3 # Use PHP 8.3 runtime
77 commands :
8- - echo Installing Composer and dependencies...
8+ - echo "π¦ Installing Composer and Laravel dependencies..."
9+
10+ # Install Composer locally (without global install)
911 - curl -sS https://getcomposer.org/installer | php
1012 - php composer.phar install --no-interaction --prefer-dist --optimize-autoloader
11- - echo "Composer dependencies installed."
13+ - echo "β
Composer dependencies installed."
1214
13- - echo "Installing additional dependencies..."
15+ # Install additional system packages if needed (e.g., SQLite for testing)
16+ - echo "π₯ Installing additional system dependencies..."
1417 - export DEBIAN_FRONTEND=noninteractive
1518 - apt-get update
1619 - apt-get install -y sqlite3
17- - echo "Additional dependencies installed."
20+ - echo "β
System dependencies installed."
1821
1922 pre_build :
2023 commands :
2124 - echo "π§ Preparing Laravel environment..."
2225
23- # Check if .env. production exists, then copy it
26+ # Copy production environment file if it exists
2427 - if [ -f .env.production ]; then cp .env.production .env; else cp .env.example .env; fi
28+ - echo "π Environment file set."
2529
26- # ( Optional) Create SQLite file if using SQLite
30+ # Optional: Create empty SQLite file if DB_CONNECTION is set to sqlite
2731 - if grep -q "DB_CONNECTION=sqlite" .env; then touch database/database.sqlite; fi
32+ - echo "ποΈ SQLite database initialized if needed."
2833
29- - echo "π§ͺ Running Laravel migrations..."
34+ # Run database migrations
35+ - echo "π§± Running Laravel migrations..."
3036 - php artisan migrate --force
3137
32- - echo "π Generating application key..."
38+ # Generate application encryption key
39+ - echo "π Generating Laravel app key..."
3340 - php artisan key:generate --force
3441
35- - echo "π Optimizing Laravel..."
42+ # Laravel optimization (combines config, route, and view caching)
43+ - echo "π Running Laravel optimization commands..."
3644 - php artisan optimize
45+ - echo "β
Laravel optimized."
3746
3847 build :
3948 commands :
40- - echo "π§ͺ Running Laravel Tests ..."
49+ - echo "π§ͺ Running Laravel unit tests ..."
4150 - php artisan test --testsuite=Unit --stop-on-failure
4251
43- - echo "β
Build completed."
52+ - echo "β
Build and testing phase completed."
4453
4554 post_build :
4655 commands :
47- - echo "π Deployment ready! Triggering post- deployment hook.. ."
56+ - echo "π Post-build : Ready for deployment trigger or next pipeline stage ."
0 commit comments