Commit Status Publisher
Last modified: 20 April 2023Commit status publisher is a build feature which allows TeamCity to automatically attach build statuses of your commits in an external system. The feature is implemented as a plugin bundled since TeamCity 10.0; for earlier TeamCity versions the stand-alone plugin is used.
The supported systems are:
JetBrains Upsource
GitHub (the build statuses for pull requests are supported as well)
GitLab
note
If you use a recent version of GitLab (>= 9.0), i t is recommended to use the GitLab URL of the following format:
http[s]://<hostname>[:<port>]/api/v4
asGitLab will stop 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 toapi/v4.
For older versions of GitLab, use the GitLab URL of the format
http[s]://<hostname>[:<port>]/api/v3.
TFS/VSTS-hosted Git (since TeamCity 2017.2)
tip
Personal Access Tokens can be used for authentication. If a Integrating TeamCity with VCS Hosting Services is configured, the personal access token can be automatically filled from the project connection.
Atlassian Bitbucket Server (formerly Stash) and Atlassian Bitbucket Cloud
note
Make sure that the TeamCity server URL is FQDN, e.g.
http://myteamcity.domain.com:8111
. Short names, e.g.http://myteamcity:8111
are rejected by the Bitbucket API.tip
For Bitbucket Cloud team accounts, it is possible to use the team name as the username, and the API key as the password.
Gerrit Code Review tool.
To use the tool:
Add the build feature to your build configuration,
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 (since TeamCity 2017.1)
select your system as the publisher, and specify its connection details and credentials
Test the connection (since TeamCity 2017.1)
Save your settings.
See the example below to configure sending the status of builds with changes included in your pull request from TeamCity to GitHub.
Configure the branch specification in your VCS Root ensuring that it includes pull requests. Detailed information is available in the Branch specification section of this TeamCity blog post.
Add the 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:
Save your settings.
Commit changes to your source code and create a pull request in GitHub, then r un 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: 1) It will show you whether the check is in progress
, whether it failed
or is successful
2) hovering over the commit status will display the build summary 3) clicking the build status sign or the Details link will open the build results page in TeamCity:
This information is also available on the Commits tab of your pull request details:
Similarly to the previous page, clicking the build status icon opens the build results page in the TeamCity web UI:
Thanks for your feedback!