首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于在部署时通过ssh克隆github存储库的Jenkins凭证

用于在部署时通过ssh克隆github存储库的Jenkins凭证
EN

Stack Overflow用户
提问于 2016-08-03 22:05:38
回答 1查看 762关注 0票数 0

我在让jenkins更新作曲家时遇到了一些问题,因为其中一个作曲家依赖项是托管在Github上的私有git代码库。

在命令行中使用composer update命令时,我也遇到了问题:

代码语言:javascript
复制
$ 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

错误:

代码语言:javascript
复制
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中有以下存储库设置:

代码语言:javascript
复制
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/<Org>/<Project>.git"
    }
]

即使没有-n (交互模式),我也可以输入github oauth令牌,让composer报告令牌已保存,但仍然会收到错误。

我是不是把auth.json放错了地方,或者我应该以不同的方式进行授权?

(为了部署工作,在github上发布专有源代码显然是不可能的)

EN

回答 1

Stack Overflow用户

发布于 2016-08-03 22:27:45

我得到了"composer update“命令(命令行和通过jenkins)。

在实际阅读错误消息并了解存储库对用户不可用后,登录到github,我通过确保github用户实际上被允许对存储库进行读访问来解决我的问题。

:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38745918

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档