request latest v1 version of composer and retry infinite the package update on build

This commit is contained in:
Ralf Becker 2021-09-23 10:51:22 +02:00
parent d3be8cd82c
commit c18abe835f
2 changed files with 7 additions and 5 deletions

View File

@ -68,8 +68,8 @@ else \
fi; \ fi; \
rm composer-setup.php; \ rm composer-setup.php; \
exit $RESULT' \ exit $RESULT' \
# build EGroupware # build EGroupware (Horde using a PEAR repo requires Composer v1)
&& composer.phar self-update 1.10.22 \ && composer.phar self-update --1 \
&& cd /usr/share \ && cd /usr/share \
&& [ $PHP_VERSION = "8.0" ] && COMPOSER_EXTRA=--ignore-platform-reqs || true \ && [ $PHP_VERSION = "8.0" ] && COMPOSER_EXTRA=--ignore-platform-reqs || true \
&& composer.phar create-project $COMPOSER_EXTRA --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \ && composer.phar create-project $COMPOSER_EXTRA --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \

View File

@ -359,11 +359,13 @@ function do_tag()
update_composer_json_version($config['tag']); update_composer_json_version($config['tag']);
// might require more then one run, as pushed tags need to be picked up by packagist // might require more then one run, as pushed tags need to be picked up by packagist
$output = $ret = null; $output = $ret = null;
$timeout = $retries = 10; $timeout = 30;
$try = 0;
$cmd = $config['composer'].' update --ignore-platform-reqs --no-dev egroupware/\*'; $cmd = $config['composer'].' update --ignore-platform-reqs --no-dev egroupware/\*';
for($try=1; $try <= $retries && run_cmd($cmd, $output, $try < $retries ? 2 : null); ++$try) while(run_cmd($cmd, $output, 2))
{ {
error_log("Retry $try/$retries in $timeout seconds ..."); ++$try;
error_log("$try. retry in $timeout seconds ...");
sleep($timeout); sleep($timeout);
} }
run_cmd($config['git'].' commit -m '.escapeshellarg('Updating dependencies for '.$config['tag']).' composer.{json,lock}'); run_cmd($config['git'].' commit -m '.escapeshellarg('Updating dependencies for '.$config['tag']).' composer.{json,lock}');