获取Bitbucket私有存储库时出错
问题描述:
我正在使用Openshift 3服务。我试图从我的专用Bitbucket存储库中获取数据。通过使用PuTTy for Windows,我创建了公钥和私钥。公钥作为Access密钥成功加载到Bitbucket中。然后,我通过Openshift Web控制台为我的应用程序创建了一个新的秘密,将其设置为SSH,加载私钥并将此秘密与构建器服务链接。在此之后,我修改了构建配置并为我的Bitbucket repo设置了一个具有所需名称的秘密(从下拉框中选择)。但是当我运行构建过程时(“开始构建”),我收到一个错误“获取源失败”。有我的生成日志中的行:获取Bitbucket私有存储库时出错
Cloning "ssh://bitbucket.org/<my_name>/<my_private_repo>.git" ...
error: build error: Warning: Permanently added 'bitbucket.org,104.192.143.3' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
是否有可能从Web控制台设置构建过程?在此先感谢您的任何建议。
答
要有OpenShift V3作品有私人到位桶回购,我用了以下内容:
在OpenShift Web控制台,创建一个项目
-
使用到位桶登录信息创建一个秘密
* Web控制台版本*
从Web控制台中,单击面包屑中的项目名称,您将看到左侧菜单。
选择资源>秘密
单击创建秘密(右上)
休假基本身份验证
输入秘密名
bitbucket
输入您的到位桶的用户名和密码
单击创建
单击添加到项目
*命令行版本*
- 添加存储您的到位桶登录一个秘密:
$ oc login This should select your project or if it did not, use the oc project PROJECTNAME $ oc secrets new-basicauth bitbucket --username=gregorifaroux -- password=MY_PASSWORD $ oc secrets link builder bitbucket
在Web控制台,我选择Java & WilfFly
把你的Git网址:
- 单击高级选项链接,然后选择秘密拉:
https://[email protected]/gregorifaroux/MYPRIVATEREPO.git
bitbucket
,它应该工作。如果您已经完成了构建,则可以单击编辑,然后选择高级选项以选择拉密。
我无法得到如下不同的博客和文档的关键工作。
你添加了第二公钥到位桶? –
你能告诉我你是什么意思?我添加了一个公钥作为所需存储库的访问键。我在Openshift作为秘密使用这对私钥。 – tvolf
您在Openshift中创建了第二个密钥对,对吗?您是否已将第二个公钥添加到Bitbucket的访问控制中? –