root
Attaches the specified VCS root with the given checkout rules to a template or buildType
VCS Root, that is used to store Kotlin DSL Versioned Settings, is not committed to the DSL, but could be referenced with DslContext.settingsRoot.
Example. Reference VCS Root, that is used to store Kotlin DSL Versioned Settings, in build type.
project {
// ...
buildType{
id = "MyBuild"
name = "MyBuild"
vcs {
root(DslContext.settingsRoot)
}
// ...
}
}
Content copied to clipboard
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>"
}
})
Content copied to clipboard
Parameters
root
VCS root
rules
checkout rules, omit if you want to checkout the entire repository
See also
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
root Id
VCS root id
rules
checkout rules, omit if you want to checkout the entire repository