如何在Openshift 3中设置对私有github存储库的访问?

SMi*_*Mix 4 credentials github repository openshift

好吧,我正在使用Openshift来托管node.js应用程序,有些东西需要是私有的.所以我需要让Openshift私下访问我的Git存储库.我在互联网上找到了一些教程,但没有人帮助过我.我尝试使用PuTTY,我使用Git Bash,但我每次都失败了.每次我从Openshift得到这个错误:

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

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

那么,如何设置Openshift来访问私有存储库呢?我正在使用OpenShift 3.

Jér*_*nge 11

由于配置中缺少最后一步,我花了一些时间来弄明白.

为了让OpenShift 3访问私有github存储库,我执行了以下操作:

> oc secrets new-basicauth github-credentials --username=<yourgithubusername> --password=<yourgithubpassword>
Run Code Online (Sandbox Code Playgroud)

它返回:

secret/github-credentials
Run Code Online (Sandbox Code Playgroud)

然后(这里是缺少的部分)来自Openshift 3网络界面:

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