2017-05-17 62 views
2

那么,我使用的是Openshift来承载一个node.js应用程序,有些东西需要是私有的。所以我需要让Openshift私下使用我的Git仓库。 我在网上找到了一些教程,但没有人帮助我。 我尝试过使用PuTTY,我使用Git Bash,但每次都失败。 每次我从Openshift得到这个错误:如何在Openshift 3中设置对私人github存储库的访问?

error: build error: failed to fetch requested repository "myrepository.git" with provided credentials

(我在错误改变了存储库URL)

嗯,我能做些什么来设置Openshift接取私人仓库? 我正在使用OpenShift 3.

+0

如果您使用OpenShift 3,您需要的是源克隆机密。请参阅https://docs.openshift.com/container-platform/3.5/dev_guide/builds/build_inputs.html#source-clone-secrets请注意,您没有查看较早的OpenShift 2文档。如果有人提到''rhc''是OpenShift 2,而不是OpenShift 3。 –

回答

3

我花了一点时间弄清楚,因为configuration中最后一步缺失。

为了给OpenShift 3次进入私人github上库,我执行以下操作:

> oc secrets new-basicauth github-credentials --username=<yourgithubusername> --password=<yourgithubpassword> 

它返回:

secret/github-credentials 

然后(这里是缺少的一部分)从Openshift 3 web界面:

  1. 点击Build
  2. 单击应用程序的链接
  3. 右上角上,单击Action并选择Edit
  4. 底下Git Repository URL,点击Advanced Options
  5. Source Secrets,选择在屏幕的底部github-credentials
  6. 点击Save
相关问题