" php composer.phar自我更新"挂起来

时间:2017-02-19 20:35:40

标签: php symfony composer-php appveyor

我有一个在GitHub上托管并集成在AppVeyor中的项目。

这是我的appveyor.yml文件:

build: false
clone_depth: 1
clone_folder: c:\projects\asynctweetsbundle

# https://github.com/travis-ci/travis-ci/issues/3005#issuecomment-71320541
skip_commits:
    message: /.*\[skip appveyor\].*/

cache:
    - '%LOCALAPPDATA%\Composer\files'
    - c:\projects\asynctweetsbundle\composer.phar

init:
    - SET PATH=c:\php;%PATH%
    - SET COMPOSER_NO_INTERACTION=1
    - SET ANSICON=121x90 (121x90)
    - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f

install:
    - mkdir c:\php && cd c:\php
    - appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/cacert.pem
    - appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.5.9-nts-Win32-VC11-x86.zip
    - 7z x php-5.5.9-nts-Win32-VC11-x86.zip -y >nul
    - del /Q *.zip
    - copy /Y php.ini-development php.ini
    - echo max_execution_time=600 >> php.ini
    - echo date.timezone="UTC" >> php.ini
    - echo extension_dir=ext >> php.ini
    - echo zend_extension=php_opcache.dll >> php.ini
    - echo opcache.enable_cli=1 >> php.ini
    - echo extension=php_openssl.dll >> php.ini
    - echo extension=php_apcu.dll >> php.ini
    - echo apc.enable_cli=1 >> php.ini
    - echo extension=php_intl.dll >> php.ini
    - echo extension=php_mbstring.dll >> php.ini
    - echo extension=php_fileinfo.dll >> php.ini
    - echo extension=php_pdo_sqlite.dll >> php.ini
    - echo extension=php_curl.dll >> php.ini
    - echo curl.cainfo=c:\php\cacert.pem >> php.ini
    - cd c:\projects\asynctweetsbundle
    - echo "OK"
    - IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.3.2/composer.phar)
    - echo "OK"
    - php composer.phar self-update -vvv
    - echo "OK"
    - php composer.phar require "symfony/symfony:2.8.*" -vv --profile --no-progress --ansi

test_script:
    - cd c:\projects\asynctweetsbundle
    - php vendor/bin/phpunit --colors=never
    - php vendor/bin/behat

它基于appveyor.yml file from Symfony

这是输出:

Build started
SET PATH=c:\php;%PATH%
SET COMPOSER_NO_INTERACTION=1
SET ANSICON=121x90 (121x90)
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
The operation completed successfully.
git clone -q --depth=1 --branch=feature/#32-fix-test-on-AppVeyor https://github.com/alexislefebvre/AsyncTweetsBundle.git c:\projects\asynctweetsbundle
git checkout -qf ce1f8da89644da6616bf374d1ac1d7fb402e1b8f
Running Install scripts
mkdir c:\php && cd c:\php
appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/cacert.pem
Downloading cacert.pem (253,628 bytes)...100%
appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.5.9-nts-Win32-VC11-x86.zip
Downloading php-5.5.9-nts-Win32-VC11-x86.zip (19,181,918 bytes)...100%
7z x php-5.5.9-nts-Win32-VC11-x86.zip -y >nul
del /Q *.zip
copy /Y php.ini-development php.ini
        1 file(s) copied.
echo max_execution_time=600 >> php.ini
echo date.timezone="UTC" >> php.ini
echo extension_dir=ext >> php.ini
echo zend_extension=php_opcache.dll >> php.ini
echo opcache.enable_cli=1 >> php.ini
echo extension=php_openssl.dll >> php.ini
echo extension=php_apcu.dll >> php.ini
echo apc.enable_cli=1 >> php.ini
echo extension=php_intl.dll >> php.ini
echo extension=php_mbstring.dll >> php.ini
echo extension=php_fileinfo.dll >> php.ini
echo extension=php_pdo_sqlite.dll >> php.ini
echo extension=php_curl.dll >> php.ini
echo curl.cainfo=c:\php\cacert.pem >> php.ini
cd c:\projects\asynctweetsbundle
echo "OK"
"OK"
IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.3.2/composer.phar)
Downloading composer.phar (1,816,271 bytes)...100%
echo "OK"
"OK"
php composer.phar self-update -vvv

正如您在this build上看到的那样,构建会在php composer.phar self-update -vvv步骤中挂起。

如何阻止Composer挂起?

1 个答案:

答案 0 :(得分:1)

以下是当前运行构建的VM的屏幕截图。希望有所帮助。

enter image description here