From 7ae017d78c65ea100e252359fe45c250ea724b16 Mon Sep 17 00:00:00 2001 From: David Alger <david@classyllama.com> Date: Tue, 30 Jun 2015 14:23:15 -0500 Subject: [PATCH] Updated travis.yml to check for CASHER_DIR env variable before using custom version of composer. --- .travis.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5885f0b2792..a7efddd8752 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,16 @@ matrix: before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix - - sh -c "if [ -x $HOME/.cache/bin/composer ]; then $HOME/.cache/bin/composer self-update; echo ''; else mkdir -p $HOME/.cache/bin; curl --connect-timeout 30 -sS 'https://getcomposer.org/installer' | php -- --install-dir $HOME/.cache/bin/ --filename composer; fi" - - $HOME/.cache/bin/composer --version + - sh -c 'if [ "$CASHER_DIR" ]; then + if [ -x $HOME/.cache/bin/composer ]; then + $HOME/.cache/bin/composer self-update; echo ''; + else + mkdir -p $HOME/.cache/bin; + curl --connect-timeout 30 -sS https://getcomposer.org/installer \ + | php -- --install-dir $HOME/.cache/bin/ --filename composer; + fi + fi' + - export PATH="$HOME/.cache/bin:$PATH" before_script: # Mock mail - sudo service postfix stop @@ -53,7 +61,7 @@ before_script: # Change memory_limit for travis - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv rehash; - - $HOME/.cache/bin/composer install --no-interaction --prefer-dist + - composer install --no-interaction --prefer-dist script: # Unit tests - sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi" @@ -66,4 +74,4 @@ script: # Static tests [Code Style] - sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testCodeStyle'; fi" # Static tests [Code Style] - - sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi" \ No newline at end of file + - sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi" -- GitLab