I am new to using TeamCity. I am trying to figure out how to build code from my private GitHub repository. In an attempt to do this, I did the following.
Created the Deployment Key
- Created a new SSH key using PuttyGen.
- Gave the key a passphrase.
- Saved the private key as "private.ppk".
- Saved the public key as "public.pub".
- Exported the key in OpenSSH format as "key.ssh" using Conversions -> Export OpenSSH key.
Added the Deployment Key to GitHub
- When to project repo (i.e. https://github.com//)
- Clicked "Settings"
- Clicked "Deploy Keys"
- Clicked "Add Deploy Key"
- In "Add Deploy Key", entered "TeamCity" as the title, and copied and pasted the public key from PuTTYGen into the "Key" field.
Created my Project in TeamCity
- Type of VCS: Git
- VCS root name: "Project master"
- VCS root id: "Project_Master"
- Fetch URL: "git://github.com//.git
- Default Branch: "refs/heads/master"
- Authentication Method: "Uploaded Key"
- Username: "git"
- Uploaded Key: "key.ssh" (uploaded earlier)
- Passphrase:
When I click "Test connection", I receive an error. The error is:
Test connection failed in <ProjectName> :: <BuildName>
Incorrect url git://[email protected]/<username>/<repo-name>.git: anonymous git url should not contain a username
If I remove the "Username" field, I get the same error. If I change the Fetch URL to be the url listed in GitHub (https://github.com//.git), I get an error that says:
Test connection failed in <ProjectName> :: <BuildName>
List remote refs failed: org.eclipse.jgit.errors.TransportException: https://github.com/<username>/<repo-name>.git: not authorized
What am I doing wrong?