TeamCity 2019.1 Help

Commit Status Publisher

Commit status publisher is a build feature which allows TeamCity to automatically send build statuses of your commits to an external system. The feature is implemented as an open-source plugin bundled with TeamCity.

The supported systems are:

  • JetBrains Upsource

  • GitHub (the build statuses for pull requests are supported as well)

  • GitLab

  • TFS/VSTS-hosted Git (supported statuses: Pending, Succeeded, Failed, Error)

  • Atlassian Bitbucket Server (formerly Stash) and Atlassian Bitbucket Cloud

  • Gerrit Code Review tool 2.6+

Provider-specific Confguration

GitLab

If you use a recent version of GitLab (>= 9.0), it is recommended to use the GitLab URL of the following format: http[s]://<hostname>[:<port>]/api/v4 as GitLab stops supporting the v3 API in GitLab 11. If you have /api/v3 in your current TeamCity configurations, they may stop working with GitLab 11+, so consider changing the server URL to api/v4.

For older versions of GitLab, use the GitLab URL of the format http[s]://<hostname>[:<port>]/api/v3.

Bitbucket

Make sure that the TeamCity server URL is FQDN, for example, http://myteamcity.domain.com:8111. Short names, for example, http://myteamcity:8111 are rejected by the Bitbucket API.
For Bitbucket Cloud team accounts, it is possible to use the team name as the username, and the API key as the password.

Gerrit

Commit Status Publisher in TeamCity 2018.1 supports Gerrit versions 2.6+. For configuring integration with earlier Gerrit versions please contact our support.

TFS/VSTS

In 2019, Visual Studio Team Services and Team Foundation Server have been renamed to Azure DevOps Services and Azure DevOps Server.

Personal Access Tokens can be used for authentication. If a VSTS connection is configured, the personal access token can be automatically filled from the project connection.

Using Commit Status Publisher

  1. Add the build feature to your build configuration.

  2. Use the default All attached VCS roots option if you want Commit Status Publisher to attempt publishing statuses for commits in all attached VCS roots or select a single repository for publishing build statuses.

  3. Select your system as the publisher, and specify its connection details and credentials.

  4. Test the connection

  5. Save your settings.

Example: Configuring Pull Requests Status Publishing to GitHub

The example below demonstrates how to configure sending the status of builds with changes included in your pull request from TeamCity to GitHub.

  1. Use pull requests build feature to configure pull requests branches. Alternatively you can make the branches available by configuring the branch specification in your VCS Root while ensuring that it includes pull requests branches (see also related blog post).

  2. Add the Commit Status Publisher build feature:
    • Use the default All attached VCS roots option to publish statuses for commits in all attached VCS roots

    • Select GitHub as the publisher and specify its connection details and credentials and test the connection:

Testing connection to GitHub

  1. Save your settings.

  2. Commit changes to your source code and create a pull request in GitHub, then run a build with your changes in TeamCity. The Commit Status Publisher will inform you on the status of the build with your pull request changes:
    • It will show you whether the check is:
      • in progress progress.png

      • failed Failed.png

      • successful Successful.png

    • hovering over the commit status will display the build summary

    • clicking the build status sign or the Details link will open the build results page in TeamCity:

Pull Requests | Conversation

This information is also available on the Commits tab of your pull request details:

Pull Requests | Commits

Similarly to the previous page, clicking the build status icon opens the build results page in the TeamCity web UI:

Build results