Integrating TeamCity with VCS Hosting Services
You can create presets of connections to the following hosting services:
Once created, such a connection can serve as a base for different operations: creating projects from URL, creating VCS roots, integrating with issue trackers, and authenticating users in TeamCity using their external profiles.
Connections are configured on the Project Administration | Connections page. Each connection is accessible in the current project and all its subprojects. If you use global VCS hosting services for your whole organization, it makes sense to configure a single connection to such a service on the Root project level. This way, the users will be able to quickly access the list of the organization's repositories when creating subprojects or editing projects' settings.
Connecting to GitHub
There are two types of GitHub connections: GitHub Enterprise and GitHub.com. Choose it depending on your GitHub account type.
A connection to GitHub can be used to:
create a project from GitHub URL;
create a VCS root from URL;
create a Git VCS root;
integrate with a GitHub issue tracker;
enable GitHub.com authentication.
The GitHub connection form provides multiple parameters. You need to use them to create a new OAuth application in GitHub.
After the app is created:
Copy its client ID and secret.
Go back to the connection form in TeamCity.
Paste the GitHub server URL (only for Enterprise) and the app ID and secret.
Save the connection.
If you use a GitHub Enterprise server with HTTPS, you need to also upload its HTTPS certificate as described here.
A GitHub icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your GitHub profile. TeamCity will be granted full control of your private repositories and get the Write repository hooks permission. If you configure multiple GitHub integrations, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.
Connecting to Bitbucket Cloud
A connection to Bitbucket Cloud can be used to:
create a project from Bitbucket URL;
create a VCS root from URL;
create a Mercurial VCS root;
integrate with a Bitbucket Cloud issue tracker;
enable BitBucket Cloud authentication.
The Bitbucket Cloud connection form provides multiple parameters. You need to use them for creating a new OAuth consumer in Bitbucket.
After the consumer is created:
Copy its key and secret.
Go back to the connection form in TeamCity.
Paste the key and secret.
Save the connection.
A Bitbucket icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your Bitbucket profile. TeamCity will be granted access to your public repositories. For private repositories, you will need to provide Bitbucket credentials to be used for authentication by TeamCity, as Bitbucket Cloud does not provide non-expiring access tokens. See the related discussion. If you configure multiple Bitbucket connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.
Connecting to GitLab
There are two types of GitLab connections: GitLab CE/EE and GitLab.com. Choose it depending on your GitHub account type.
A connection to GitLab can be used to:
create a project from GitLab URL;
create a VCS root from URL;
enable GitLab.com authentication.
The GitLab connection form provides multiple parameters. You need to use them to create a new OAuth application in GitLab.
After the app is created:
Copy its client ID and secret.
Go back to the connection form in TeamCity.
Paste the GitLab server URL (only for CE/EE) and the app ID and secret.
Save the connection.
If you use a GitLab CE/EE server with HTTPS, you need to also upload its HTTPS certificate as described here.
A GitLab icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your GitLab profile. TeamCity will be granted access to your repositories. If you configure multiple GitLab connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.
Connecting to Azure DevOps Services
A connection to Azure DevOps Services (or Azure DevOps Server, formerly Team Foundation Server) can be used to:
create a project from URL;
create a VCS root from URL;
create a TFS VCS root;
integrate with a Team Foundation Work Items issue tracker;
automatically apply an access token when configuring Commit Status Publisher for Git repositories.
Before configuring this connection, you need to sign in to your Azure DevOps account and create a personal access token with All scopes as described here
Then, go back to the connection form in TeamCity:
- Enter your Azure server URL:
https://{account}.visualstudio.com
for Azure DevOpshttps://{server}:8080/tfs/
for VSTS
Paste your Azure token.
Save the connection.
An Azure DevOps icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your Azure profile. TeamCity will be granted full access to all the Azure resources available to you. If you configure multiple Azure connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.