I am facing build issue with Travis CI. I am new with Travis CI and as a basic step I have created a file .travis.yml into the GITHUB repository. But whenever I restart the build, it is failing.
I don't find any issue if I download the source code manually or install the framework using composer to run, it works perfect!! But not sure why Travis is failing.
GitHub repository and Travis CI
Will be grateful if anyone help me to find out the issue and fix it.
答案 0 :(得分:1)
看起来你可能遇到了GitHub的API rate limit。您可以在执行--prefer-source
时使用composer install
标记来规避这一点。
或者,您可以指定GitHub API令牌以使用“您的”用户访问GitHub API,而不受匿名用户的速率限制的影响。 This article描述了你如何能够实现这一目标 - 虽然它是法语的,所以我会尝试给出一个简短的总结(如果我读错了,请纠正我,我的法语有点不合时):
public_repo
权限(您还可以检查private_repo
以从Travis克隆私有存储库。)将令牌包含在.travis.yml
中。由于该文件是公共的,encrypt the API key通过在命令行上运行以下两个命令:
gem install travis
travis encrypt GITHUB_COMPOSER_AUTH=123456789 --add
在执行composer install
之前配置Composer:
composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH
composer install --dev --no-interaction
Voilà
答案 1 :(得分:-1)
谢谢大家。问题已得到解决。
简单的设置步骤:
.travis.yml
文件。在存储库设置页面中添加Travis作为服务。按照Getting Started with Travis CI的简单步骤操作。可以帮助别人。