Commit Status Publisher
A build feature publishing status to external system
Example. Enables publishing build statuses to commits in JetBrains Space.
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 = space {
authType = connection {
connectionId = "<JetBrains Space connection id>"
}
displayName = "<Display name>" // optional, "TeamCity" by default
}
}
Content copied to clipboard }
}
Example. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in GitLab.com / GitLab CE/EE. Instead of personal token authentication a refreshable access token stored in TeamCity is used.
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)
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}
Example. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in Bitbucket Cloud. Instead of password authentication an access token stored in TeamCity is used.
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 = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}
Example. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in Bitbucket Server / Data Center. Instead of password authentication an access token stored in TeamCity is used.
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>"
authType = storedToken {
tokenId = "tc_token_id:*****"
}
}
}
Content copied to clipboard }
}
Example. Enables publishing build statuses to commits in 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. Enables publishing build statuses to commits in Azure DevOps Instead of password authentication an access token stored in TeamCity is used.
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 = storedToken {
tokenId = "tc_token_id:*****"
}
publishPullRequests = true // optional
}
}
Content copied to clipboard }
}
Example. Enables publishing build statuses to Perforce 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 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
Functions
Publish build status to Azure DevOps / TFS
Publish status to Bitbucket Cloud
Publish status 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 status to GitHub
Publish status to GitLab
Publish status to JetBrains Space
Publish build status to Perforce Helix Swarm
Publish build status to Azure DevOps / TFS
Publish status to Upsource
Validates this object and reports found errors to the provided consumer