CommitStatusPublisher

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
}
}







}
}




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:*****"
}
}
}







}
}




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()
}
}





}
}




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:*****"
}
}
}







}
}




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:*****"
}
}
}







}
}




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:*****"
}
}
}







}
}




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:*****"
}
}
}







}
}




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:*****"
}
}
}






}
}




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:*****"
}
}
}








}
}




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:*****"
}
}
}







}
}




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
}
}








}
}




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
}
}








}
}




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
}
}








}
}




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>"
}
}










}
}




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:*****"
}
}







}
}




See also

Constructors

Link copied to clipboard
constructor(init: CommitStatusPublisher.() -> Unit)
constructor()

Types

Link copied to clipboard

Properties

Link copied to clipboard

Specifies whether the feature is enabled, true by default

Link copied to clipboard
var id: String?

Build feature id, if not specified will be generated

Link copied to clipboard
Link copied to clipboard
var publisher: <Error class: unknown class>

Specifies to which system a status should be published

Link copied to clipboard

Build feature type

Link copied to clipboard
var vcsRootExtId: <Error class: unknown class>

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

Link copied to clipboard

Publish build status to Azure DevOps / TFS

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun booleanParameter(customName: String? = null, trueValue: String? = "true", falseValue: String? = "false"): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun clear()
Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <T : Parametrized> copyParamsTo(target: T): T

Copies parameters of this object to the specified target

Link copied to clipboard
open fun create(): BuildFeature

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.

Link copied to clipboard
fun doubleParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard

Publish status to Gerrit Code Review

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun intParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard

Publish status to JetBrains Space

Link copied to clipboard
open fun stringParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard

Publish build status to Perforce Helix Swarm

Link copied to clipboard

Publish build status to Azure DevOps / TFS

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard
open override fun validate(consumer: ErrorConsumer)

Validates this object and reports found errors to the provided consumer