Fallback composer installs to source in CI

This commit is contained in:
Jeppe B
2026-06-10 19:22:52 +02:00
parent 7e85c74e60
commit d605eca574
2 changed files with 39 additions and 14 deletions
+17 -3
View File
@@ -68,6 +68,22 @@ retry_command() {
done
}
composer_install() {
dist_attempts="${PHP_CI_COMPOSER_RETRIES:-3}"
source_attempts="${PHP_CI_COMPOSER_SOURCE_RETRIES:-2}"
if retry_command "$dist_attempts" \
docker compose $compose_files exec -T php1 sh -lc \
'cd /var/www/html && composer install --no-interaction --prefer-dist --no-progress'; then
return 0
fi
echo "Composer dist install failed after ${dist_attempts} attempts; retrying with --prefer-source." >&2
retry_command "$source_attempts" \
docker compose $compose_files exec -T php1 sh -lc \
'cd /var/www/html && composer install --no-interaction --prefer-source --no-progress'
}
cleanup() {
status="$?"
collect_logs "$status"
@@ -112,9 +128,7 @@ tar \
-C services/nginx/app -cf - . \
| docker compose $compose_files exec -T php1 tar -C /var/www/html -xf -
retry_command "${PHP_CI_COMPOSER_RETRIES:-3}" \
docker compose $compose_files exec -T php1 sh -lc \
'cd /var/www/html && composer install --no-interaction --prefer-dist --no-progress'
composer_install
docker compose $compose_files exec -T php1 sh -lc \
"cd /var/www/html && composer test:ci:$suite"