public class GitRepository extends VcsRepository<GitRepository,GitRepositoryProperties>
Represents a git repository in Bamboo.
  • Constructor Details

    • GitRepository

      public GitRepository()
  • Method Details

    • url

      public GitRepository url(@NotNull @NotNull String url)
      Sets git repository url.
      Parameters:
      url - repository url
    • branch

      public GitRepository branch(@NotNull @NotNull 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 defined SharedCredentials to 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.
    • submodulesUseShallowClonesEnabled

      public GitRepository submodulesUseShallowClonesEnabled(boolean useSubmodulesWithShallowClones)
      Enables/disables shallow clone support for submodules. 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(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:
    • build

      protected GitRepositoryProperties build()
      Specified by:
      build in class VcsRepository<GitRepository,GitRepositoryProperties>