Well, i'm using Openshift to host a node.js application, and some things need to be private. So i need to let Openshift acess my Git repository in private. I found some tutorials in the internet, but no one helped me. I tried using PuTTY, i used Git Bash, but i failed everytime. Everytime i get this error from Openshift:
error: build error: failed to fetch requested repository "myrepository.git" with provided credentials
(i changed the repository url in the error)
Well, what can i do to setup Openshift to acess a private repository? I'm using OpenShift 3.
It took me a bit of time to figure it out, since the last step is missing in the configuration.
In order to give OpenShift 3 access to a private github repository, I performed the following:
> oc secrets new-basicauth github-credentials --username=<yourgithubusername> --password=<yourgithubpassword>
It returns:
secret/github-credentials
Then (and here is the missing part) from the Openshift 3 web interface:
Build
Action
and select Edit
Git Repository URL
, click on Advanced Options
Source Secrets
, select github-credentials
Save
at the bottom of the screen.You can try this solution: consider that I am using openshift version 3.11 So, on the left side menu click on "Builds" then "Builds" again, then click on the name of your project, now click on the action button and select "edit" option. now click on "Show advanced options", in the Build Secret Section "Create New Secret", put a new secret name and the user name and password that you use for the private repository. Now select a build secret that you have created. That is all!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With