Commit Status Publisher
A build feature publishing status to external system.
Example. Publishes build statuses to GitHub.com / GitHub Enterprise. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = github {
githubUrl = "<GitHub URL, https://api.github.com for github.com>"
authType = personalToken { // authType = password { ... } to use username and password
token = "credentialsJSON:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to GitHub.com / GitHub Enterprise. Uses the credentials of the VCS root.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = github {
githubUrl = "<GitHub URL, https://api.github.com for github.com>"
authType = vcsRoot()
}
}
Content copied to clipboard }
}Example. Publishes build statuses to GitHub.com / GitHub Enterprise. Uses a GitHub App installation token stored in TeamCity.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // A VCS root must be specified to use this authentication type
publisher = github {
githubUrl = "<GitHub URL, https://api.github.com for github.com>"
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to GitHub.com / GitHub Enterprise. Sets the buildName value as a status check name displayed in the status message posted to the VCS.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // A VCS root must be specified to use this authentication type
publisher = github {
githubUrl = "<GitHub URL, https://api.github.com for github.com>"
statusCheckName = "Customized GitHub status check name" // optional, can be used for branch protection rules
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to GitLab.com / GitLab CE/EE. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = gitlab {
gitlabApiUrl = "https://<GitLab URL>/api/v4" // optional, the URL will be composed based on the VCS root fetch URL if omitted (https://gitlab.com/api/v4 for gitlab.com)
accessToken = personalToken { // authType = vcsRoot() to take credentials from the VCS root
accessToken = "credentialsJSON:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to GitLab.com / GitLab CE/EE. Instead of personal token authentication a refreshable access token stored in TeamCity is used. Sets the buildName value as build name displayed in the status message posted to the VCS.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = gitlab {
jobName = "Customized GitLab status job name" // optional
gitlabApiUrl = "https://<GitLab URL>/api/v4" // optional, the URL will be composed based on the VCS root fetch URL if omitted (https://gitlab.com/api/v4 for gitlab.com)
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Bitbucket Cloud. The password must be Bitbucket App password generated by user. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = bitbucketCloud {
authType = password { // authType = vcsRoot() to take credentials from the VCS root
userName = "<username>"
password = "credentialsJSON:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Bitbucket Cloud. Instead of password authentication an access token stored in TeamCity is used. Sets the buildName value as build name displayed in the status message posted to the VCS.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = bitbucketCloud {
buildName = "Customized Bitbucket Cloud status build name" // optional
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Bitbucket Server / Data Center. The password can be either user's password (not recommended) or Bitbucket HTTP access token generated by user. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = bitbucketServer {
url = "<Bitbucket Server Base URL>" // optional, the URL will be composed based on the VCS root fetch URL if omitted
authType = password { // authType = vcsRoot() to take credentials from the VCS root
userName = "<username>"
password = "credentialsJSON:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Bitbucket Server / Data Center. Instead of password authentication an access token stored in TeamCity is used. Sets the buildName value as build name displayed in the status message posted to the VCS.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = bitbucketServer {
buildName = "Customized Bitbucket Server / Data Center status build name" // optional
url = "<Bitbucket Server Base URL>"
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Azure DevOps. For now only personal access token authentication type is supported. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = azureDevOps {
serverUrl = "<Azure DevOps URL>" // optional
authType = personalToken {
accessToken = "tc_token_id:*****"
}
publishPullRequests = true // optional
}
}
Content copied to clipboard }
}Example. Publishes build statuses to Azure DevOps. Instead of password authentication an access token stored in TeamCity is used. Sets the buildName value as build name displayed in the status message posted to the VCS.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = azureDevOps {
buildName = "Customized Azure DevOps status build name" // optional
serverUrl = "<Azure DevOps URL>" // optional
authType = storedToken {
tokenId = "tc_token_id:*****"
}
publishPullRequests = true // optional
}
}
Content copied to clipboard }
}Example. Enables publishing build statuses to Perforce P4 Code Review (Helix Swarm). For now only personal access token authentication type is supported. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = swarm {
serverUrl = "<Swarm URL>"
username = "<username>"
token = "credentialsJSON:*****"
createSwarmTest = true // optional, if set, TeamCity will create a test run on the P4 Code Review (Helix Swarm) server and update its status according to the build status in TeamCity.
commentOnEvents = true // optional
}
}
Content copied to clipboard }
}Example. Enables voting in Gerrit based on build statuses.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = gerrit {
server = "<Gerrit server URL>"
gerritProject = "<Gerrit project name>"
label = "<label>" // e.g. Verified
failureVote = "<failed build vote>" // e.g. -1
successVote = "<successful build vote>" // e.g. +1
userName = "<username>"
uploadedKey = "<SSH key name>"
}
}
Content copied to clipboard }
}Example. Enables publishing build statuses to JetBrains Upsource. It is not recommended to store secure values directly in the DSL code, see Managing Tokens section of our documentation.
buildType {
// Other Build Type settings ...
features {
// Other Build Features ...
commitStatusPublisher {
vcsRootExtId = "${<VCS root object>.id}" // optional, publishes to all attached git VCS roots if omitted
publisher = upsource {
serverUrl = "<Upsource URL>"
projectId = "<Upsource project id>"
userName = "<username>"
password = "credentialsJSON:*****"
}
}
Content copied to clipboard }
}See also
Properties
The type of the VCS provider to which the build status should be published.
Id of the VCS root for which commits a status should be published. Set to an empty string to publish status for all VCS roots attached to a build configuration.
Functions
Publish build statuses to Azure DevOps / TFS.
Publish status to Bitbucket Cloud
Publish build statuses to Bitbucket Server / Data Center.
Copies parameters of this object to the specified target
Creates an instance of this build feature via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Publish status to Gerrit Code Review.
Publish build statuses to GitHub.
Publish build statuses to GitLab.
Publish build statuses to JetBrains Space.
Publish build statuses to Perforce P4 Code Review (Helix Swarm).
Publish build status to Azure DevOps / TFS.
Publish build statuses to Upsource.
Validates this object and reports found errors to the provided consumer