Skip to content

Commit bd5d0f0

Browse files
committed
Travis: retry composer install on failure
The builds are failing a little too often for my taste on the below error. ``` [Composer\Downloader\TransportException] Peer fingerprint did not match ``` I'm prefixing the `composer install` commands now with `travis_retry` in an attempt to get round this problem. Ref: * https://docs.travis-ci.com/user/common-build-problems/#timeouts-installing-dependencies
1 parent eeedea0 commit bd5d0f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,26 @@ before_install:
134134
- |
135135
if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" ]]; then
136136
# Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
137-
composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
137+
travis_retry composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
138138
fi
139139
- |
140140
if [[ $PHPCS_VERSION != "n/a" ]]; then
141-
composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION}
141+
travis_retry composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION}
142142
fi
143143
- |
144144
if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" ]]; then
145145
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
146-
composer remove --dev phpunit/phpunit --no-update --no-scripts
146+
travis_retry composer remove --dev phpunit/phpunit --no-update --no-scripts
147147
fi
148148
149149
# --prefer-dist will allow for optimal use of the travis caching ability.
150150
# The Composer PHPCS plugin takes care of setting the installed_paths for PHPCS.
151151
- |
152152
if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
153153
# Not all dependencies allow for installing on nightly yet, so ignore platform requirements.
154-
composer install --prefer-dist --no-suggest --ignore-platform-reqs
154+
travis_retry composer install --prefer-dist --no-suggest --ignore-platform-reqs
155155
else
156-
composer install --prefer-dist --no-suggest
156+
travis_retry composer install --prefer-dist --no-suggest
157157
fi
158158
159159

0 commit comments

Comments
 (0)