【发布时间】:2016-12-09 07:29:50
【问题描述】:
我在让 jenkins 进行作曲家更新时遇到了一些问题,因为作曲家依赖项之一是托管在 Github 上的私有 git 存储库
我也无法让 composer update 命令在命令行中工作:
$ cd /var/lib/jenkins/jobs/JOB/workspace
$ ls -la auth.json
-rw-rw-r-- 1 jenkins jenkins 99 Aug 3 15:49 auth.json
$ cat auth.json
{
"github-oauth" : {
"github.com" : "<notAvailableOnSO>"
}
}
$ composer update -n
错误:
Failed to clone the git@github.com:<Org>/<Project>.git repository, try running in interactive mode so that you can enter your GitHub credentials
[RuntimeException]
Failed to execute git clone --mirror 'https://***:***@github.com/<Org>/<Project>.git' '/var/lib/jenkins/.composer/cache/vcs/git-github.com-<Org>-<Project>.git/'
Cloning into bare repository '/var/lib/jenkins/.composer/cache/vcs/git-github.com-<Org>-<Project>.git'...
remote: Repository not found.
fatal: repository 'https://***:***@github.com/<Org>/<Project>.git/' not found
我正在尝试更新的项目的 composer.json 中有这个存储库设置:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/<Org>/<Project>.git"
}
]
即使没有 -n(交互模式),我也可以输入 github oauth 令牌并让 composer 报告令牌已保存,但仍然出现错误。
我是否将 auth.json 放在了错误的位置,还是应该以不同的方式进行授权?
(为了部署工作,显然不可能在github上发布专有源代码)
【问题讨论】:
-
使用命令 $ ssh -T git@github.com 测试 ssh 设置返回 Hi tasklift-jenkins!您已成功通过身份验证,但 GitHub 不提供 shell 访问权限。
标签: github jenkins oauth composer-php