Trouble Adding Git Repo to Unity Cloud Build

I have my Git repository hosted on my personal Linux server and I wanted to add the repository to take advantage of unity cloud build.

I originally put the repo into a directory inside of my www directory so that it could be browsed to, I assumed that is all unity would need to be able to clone the directory, however they asked that I add an ssh rsa key to my repo so that they have full access to the repo.

This is where I am having some problems.

I added a unity account onto my server and I copied the key that was given to me into the ~/.ssh/id_rsa file, unity was unable to access the repo, so I put the key into putty and tried to log in and it still didn’t work.

I have 2factor authentication using the google authenticator enabled on my server, is this causing some sort of problem preventing rsa keys from working?

One way to test this is to try cloning your Git repo onto another computer from the command line. Something like:

mkdir test-clone
cd test-clone
git clone http://your.server/path/to/your/repo/ .

That path may or may not require .git at the end, like this:

git clone http://your.server/path/to/your/repo/.git .

This will help you figure out if you can connect and download repos from your server, and provide some debugging tips. I ran into this error doing a test: “info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?”. To fix this, I edited .git/config to point to the full HTTP URL of my repo, and then I ran “git update-server-info” to generate the info/refs file. Then I re-uploaded the entire repo to my HTTP server (on a different box), and was able to clone it from the command line, and clone it into a Cloud Build project.

I don’t know that we’ve encountered Git servers using two-factor auth before. Which software package are you using? This one: GitHub - google/google-authenticator: Open source version of Google Authenticator (except the Android app) ?

I hope this is helpful.

Cheers,
Patrick

Ya I am using that two-factor package

Ok, if you get command-line check-out to work from your server with an http:// or https:// URL, no SSH key should be required, and the two-factor auth should be skipped. Cloud Build prompts you to add the SSH key when it can’t successfully log in, but I don’t think it will fix your case.

Hope that helps solve things!

Cheers,
Patrick