root

fun root(root: VcsRoot, vararg rules: String)

Attaches the specified VCS root with the given checkout rules to a template or buildType

Example. Add Git VCS Root.

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

See also

Parameters

root

VCS root

rules

checkout rules, omit if you want to checkout the entire repository


fun root(rootId: Id, vararg rules: String)

Attaches a VCS root with the specified id with the given checkout rules to a template or buildType. This method can be used to attach a VCS root which is not defined in Kotlin.

Parameters

rootId

VCS root id

rules

checkout rules, omit if you want to checkout the entire repository