fix: add pcntl extension to CI composer install step

The Woodpecker CI composer-install step was missing the pcntl extension,
causing builds to fail when composer verifies platform requirements for
laravel/horizon.

Added pcntl to the docker-php-ext-install command in .woodpecker/.ci.yml
to match the extensions installed in the production Dockerfile.

Also added test-ci-locally.sh script to test CI steps locally before pushing.
This commit is contained in:
Jon Leopard
2025-11-17 21:19:23 -07:00
parent 86fef4d021
commit 2f5cb5c0e7
2 changed files with 46 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ steps:
- apt-get install -y -qq git zip unzip libicu-dev libzip-dev libpng-dev libjpeg-dev libfreetype6-dev libpq-dev
- echo "Installing PHP extensions..."
- docker-php-ext-configure gd --with-freetype --with-jpeg
- docker-php-ext-install -j$(nproc) intl pdo pdo_pgsql zip gd
- docker-php-ext-install -j$(nproc) intl pdo pdo_pgsql zip gd pcntl
- echo "Installing Composer..."
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- echo "Creating minimal .env for package discovery..."

45
test-ci-locally.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
set -e
echo "======================================"
echo "Testing CI Composer Install Locally"
echo "======================================"
echo ""
# Use the same PHP image as CI
docker run --rm -v "$(pwd)":/app -w /app php:8.3-cli bash -c '
echo "Installing system dependencies..."
apt-get update -qq
apt-get install -y -qq git zip unzip libicu-dev libzip-dev libpng-dev libjpeg-dev libfreetype6-dev libpq-dev
echo "Installing PHP extensions..."
docker-php-ext-configure gd --with-freetype --with-jpeg
docker-php-ext-install -j$(nproc) intl pdo pdo_pgsql zip gd pcntl
echo "Installing Composer..."
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
echo "Creating minimal .env for package discovery..."
cat > .env << "EOF"
APP_NAME="Cannabrands Hub"
APP_ENV=testing
APP_KEY=base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
APP_DEBUG=true
CACHE_STORE=array
SESSION_DRIVER=array
QUEUE_CONNECTION=sync
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=testing
DB_USERNAME=testing
DB_PASSWORD=testing
EOF
echo ""
echo "Running composer install..."
composer install --no-interaction --prefer-dist --optimize-autoloader --no-progress
echo ""
echo "✅ Success! CI composer install would pass."
'