GitVcsRoot

open class GitVcsRoot : VcsRoot

Git VCS root

Example. Defines a VCS root MyVcsRoot with authentication by an SSH key and registers it in the project and a build configuration.

project {
...
vcsRoot(MyVcsRoot)

buildType{
id = "MyBuild"
name = "MyBuild"

vcs {
root(MyVcsRoot)
}
...
}
...
}

object MyVcsRoot: GitVcsRoot({
name = "My project main repository"
url = "<repository URL>"
branch = "refs/heads/main"
checkoutPolicy = AgentCheckoutPolicy.USE_MIRRORS
authMethod = uploadedKey {
uploadedKey = "<SSH key name>"
}
})























Constructors

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

Types

Link copied to clipboard

Policy for checking out sources on agent

Link copied to clipboard

Specifies flags for the "git clean" command during agent-side checkout and defines which files will be removed.

Link copied to clipboard

Specifies when the "git clean" command should be executed in case of agent-side checkout

Link copied to clipboard
Link copied to clipboard

Submodules checkout mode

Link copied to clipboard

Defines how TeamCity retrieves VCS username from git commit. When the git config contains the following

Properties

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

Specifies which files should be removed when "git clean" command is executed during agent-side checkout.

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

Specifies when the "git clean" command should be executed in case of agent-side checkout

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

Custom path to git executable on the build agent machine

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

VCS Root authentication method

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

The default branch name

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

Branch specification to use in VCS root

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

Policy for checking out sources on agent

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

Whether VCS root should include changes in submodules and check their sources for build. By default submodules are checked out.

Link copied to clipboard
open override var id: Id?

VCS root id. It appears in the web UI and is used in urls. If the VCS root has a uuid specified, then the id can be changed at any time. If uuid is omitted, then TeamCity treats a VCS root with a changed id as a new VCS root, all data associated with the old root will be lost (e.g. a commits graph). Id can also be used by some settings, e.g. as a part of parameter reference. If you change the id, you should find all its occurrences in the current project and change them too. Id must be unique across all VCS roots on the server. If id is missing, it will be generated from the class name (if the class is not from the jetbrains.buildServer.configs.kotlin package).

Link copied to clipboard

VCS root name

Link copied to clipboard

Helper for creating references to parameters of this VCS root

Link copied to clipboard
Link copied to clipboard

VCS root polling interval, in seconds

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

Custom repository push url. If not specified then the url specified in the url property is used for push operations.

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

Whether TeamCity should convert line-endings of all text files to CRLF during server-side checkout. By default false.

Link copied to clipboard

VCS type

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

Repository url

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

When this option is enabled, TeamCity creates a separate clone of the repository on each agent and uses it in the checkout directory via git alternates. This make agent-side checkout faster. By default true.

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

A username for tag/merge operations in this VCS root. Format: Username

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

Defines how TeamCity retrieves VCS username from git commit.

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

When enabled tags matched by branch specification will be shown in UI as regular branches. By default false.

Link copied to clipboard

VCS root uuid. TeamCity uses it to identify the VCS root. If uuid changes, TeamCity considers it to be a new entity. If uuid is missing, it is reconstructed from VCS root id. Uuid must be unique across all entities on the server.

Functions

Link copied to clipboard

Anonymous repository access

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(): VcsRoot

Creates an instance of this VCS root 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

SSH key on the specified path. Supported only for server-side checkout. Switch to uploaded SSH key if you want to use an agent-side checkout.

Link copied to clipboard

Default SSH key found on the machine. If you use an agent-side checkout, then this key should also be available on the build agent machines. Often it is easier to use the uploaded SSH key.

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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun id(id: String)

Sets the id to the specified value. Type of the id depends on the context in which DSL is executed: it is RelativeId when DSL context is relative, otherwise it is AbsoluteId.

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

Password authentication

Link copied to clipboard
fun removeRawParam(paramName: String)
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

Authentication with a refreshable token stored in TeamCity token storage

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

Uploaded SSH key with the specified name.

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

Validates this object and reports found errors to the provided consumer