Class GitRepository
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<T>
-
- com.atlassian.bamboo.specs.api.builders.RootEntityPropertiesBuilder<E>
-
- com.atlassian.bamboo.specs.api.builders.repository.VcsRepository<GitRepository,GitRepositoryProperties>
-
- com.atlassian.bamboo.specs.builders.repository.git.GitRepository
-
public class GitRepository extends VcsRepository<GitRepository,GitRepositoryProperties>
Represents a git repository in Bamboo.
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.specs.api.builders.repository.VcsRepository
description, name, oid, parent, project, repositoryViewer, TYPE
-
-
Constructor Summary
Constructors Constructor Description GitRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GitRepositoryauthentication(@NotNull SharedCredentialsIdentifier sharedCredentialsIdentifier)Selects a previously definedSharedCredentialsto authenticate with git server.GitRepositoryauthentication(@NotNull SshPrivateKeyAuthentication sshPrivateKeyAuthentication)Specifies SSH private key authentication.GitRepositoryauthentication(@NotNull UserPasswordAuthentication userPasswordAuthentication)Specifies username/password authentication.GitRepositorybranch(@NotNull java.lang.String branch)Sets branch to check out.protected GitRepositoryPropertiesbuild()GitRepositorychangeDetection(@NotNull VcsChangeDetection vcsChangeDetection)Sets change detection options for this repository.GitRepositorycommandTimeout(java.time.Duration commandTimeout)Specifies how much time is given for git commands to finish.GitRepositorycommandTimeoutInMinutes(int commandTimeoutMinutes)Specifies how much time in minutes is given for git commands to finish.GitRepositorydefaultChangeDetection()Resets all change detection options to defaults.GitRepositoryfetchWholeRepository(boolean fetchWholeRepository)Enforces (or not) fetching all remote refs from the repository rather than single branch.GitRepositorylfsEnabled(boolean useLfs)Enables/disables git lfs support.GitRepositoryremoteAgentCacheEnabled(boolean useRemoteAgentCache)Enables/disables caching repository content on the remote and elastic agents.GitRepositoryshallowClonesEnabled(boolean useShallowClones)Enables/disables shallow clones when checking out from the repository.GitRepositorysshKeyAppliesToSubmodules(boolean sshKeyAppliesToSubmodules)Enables/disabled authenticating to submodules with SSH key configured for this repository.GitRepositorysubmodulesEnabled(boolean useSubmodules)Enables/disables submodule support.GitRepositoryurl(@NotNull java.lang.String url)Sets git repository url.GitRepositoryverboseLogs(boolean verboseLogs)Enables/disables verbose logs from git commands.GitRepositorywithoutAuthentication()Removes authentication details.-
Methods inherited from class com.atlassian.bamboo.specs.api.builders.repository.VcsRepository
description, getIdentifier, getName, getOid, humanReadableId, humanReadableType, name, oid, oid, parent, project, repositoryViewer
-
-
-
-
Method Detail
-
url
public GitRepository url(@NotNull @NotNull java.lang.String url)
Sets git repository url.- Parameters:
url- repository url
-
branch
public GitRepository branch(@NotNull @NotNull java.lang.String branch)
Sets branch to check out.
-
withoutAuthentication
public GitRepository withoutAuthentication()
Removes authentication details. Bamboo will not enforce any authentication method when connecting to the repository. Depending on the selected protocol and git client configuration, authentication may still be performed out of Bamboo's control.
-
authentication
public GitRepository authentication(@NotNull @NotNull SharedCredentialsIdentifier sharedCredentialsIdentifier)
Selects a previously definedSharedCredentialsto authenticate with git server. Currently SSH and username/password credentials are supported.
-
authentication
public GitRepository authentication(@NotNull @NotNull UserPasswordAuthentication userPasswordAuthentication)
Specifies username/password authentication.
-
authentication
public GitRepository authentication(@NotNull @NotNull SshPrivateKeyAuthentication sshPrivateKeyAuthentication)
Specifies SSH private key authentication.
-
shallowClonesEnabled
public GitRepository shallowClonesEnabled(boolean useShallowClones)
Enables/disables shallow clones when checking out from the repository. Fetches the shallowest commit history possible. Do not use if your build depends on full repository history. Shallow clones are switched off by default.
-
submodulesEnabled
public GitRepository submodulesEnabled(boolean useSubmodules)
Enables/disables submodule support. Turned off by default.
-
sshKeyAppliesToSubmodules
public GitRepository sshKeyAppliesToSubmodules(boolean sshKeyAppliesToSubmodules)
Enables/disabled authenticating to submodules with SSH key configured for this repository.
-
remoteAgentCacheEnabled
public GitRepository remoteAgentCacheEnabled(boolean useRemoteAgentCache)
Enables/disables caching repository content on the remote and elastic agents. Bamboo uses caching to reduce bandwidth needed when retrieving source code from the repository. The feature is turned on by default.
-
commandTimeout
public GitRepository commandTimeout(java.time.Duration commandTimeout)
Specifies how much time is given for git commands to finish. Default is 180 minutes.
-
commandTimeoutInMinutes
public GitRepository commandTimeoutInMinutes(int commandTimeoutMinutes)
Specifies how much time in minutes is given for git commands to finish. Default is 180 minutes.
-
verboseLogs
public GitRepository verboseLogs(boolean verboseLogs)
Enables/disables verbose logs from git commands. Off by default.
-
fetchWholeRepository
public GitRepository fetchWholeRepository(boolean fetchWholeRepository)
Enforces (or not) fetching all remote refs from the repository rather than single branch. Off by default.
-
lfsEnabled
public GitRepository lfsEnabled(boolean useLfs)
Enables/disables git lfs support. Off by default.
-
defaultChangeDetection
public GitRepository defaultChangeDetection()
Resets all change detection options to defaults.
-
changeDetection
public GitRepository changeDetection(@NotNull @NotNull VcsChangeDetection vcsChangeDetection)
Sets change detection options for this repository.- See Also:
VcsChangeDetection
-
build
protected GitRepositoryProperties build()
- Specified by:
buildin classVcsRepository<GitRepository,GitRepositoryProperties>
-
-