Search Unity

Trouble Adding Git Repo to Unity Cloud Build

Discussion in 'Unity Build Automation' started by Tekuzo, Sep 12, 2015.

  1. Tekuzo

    Tekuzo

    Joined:
    Jan 13, 2014
    Posts:
    30
    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?
     
  2. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    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: https://github.com/google/google-authenticator ?

    I hope this is helpful.

    Cheers,
    Patrick
     
  3. Tekuzo

    Tekuzo

    Joined:
    Jan 13, 2014
    Posts:
    30
    Ya I am using that two-factor package
     
  4. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    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