【发布时间】:2015-09-25 10:16:31
【问题描述】:
我正在 Travis CI 中为我的 build 运行以下命令:
before_install:
- curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
script:
- sudo composer -nqq update
我正在手动安装composer,因为我想使用sudo,因为它只为用户安装。
我遇到的错误是:
Updating dependencies (including require-dev)
- Installing jakub-onderka/php-console-color (0.1)
Downloading: Connecting... Failed to download jakub-onderka/php-console-color from dist: The "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1" file could not be downloaded (HTTP/1.1 403 Forbidden)
Now trying to download from source
- Installing symfony/yaml (v2.7.4)
Downloading: Connecting... Failed to download symfony/yaml from dist: The "https://api.github.com/repos/symfony/Yaml/zipball/2dc7b06c065df96cc686c66da2705e5e18aef661" file could not be downloaded (HTTP/1.1 403 Forbidden)
Now trying to download from source
我已经尝试了这些链接,它们工作正常。
这是否意味着 Travis 出于某种原因阻止了 GitHub API?如果没有,我该如何解决?
通过修复,我的意思是要么知道发生了什么,要么抑制这些错误消息(例如,通过使用 composer 中的一些特殊参数或更改 JSON 文件以强制从源下载)。
我的composer.json 文件是:
{
"config": {
"vendor-dir": "/var/lib/vendor",
"bin-dir": "/usr/local/bin"
},
"require": {
"drush/drush": "dev-master"
}
}
作为参考,完整的.travis.yml 看起来像:
before_install:
- env
- curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
- sudo apt-get -qy update
install:
- sudo apt-get install vagrant
script:
- set -e # This makes build to fail on first error.
- sudo composer -nqq update
- make
- make vm
after_failure:
- sudo apt-get -qy install tree && - tree -d -L 6 # Print directory structure in the form of a tree.
- env
sudo: true
language: php
python:
- "5.5"
【问题讨论】:
标签: continuous-integration composer-php travis-ci http-status-code-403 github-api