Class BitbucketServerRepository


public class BitbucketServerRepository extends VcsRepository<BitbucketServerRepository,BitbucketServerRepositoryProperties>
Represents Bitbucket Server repository in Bamboo.
  • Constructor Details

    • BitbucketServerRepository

      public BitbucketServerRepository()
      Specifies a Bitbucket Server repository

      A repository can be global, in which case any changes made to a repository are automatically applied to all plans or jobs that use that repository. Repository can also be defined in scope of a Plan, in which case it is only accessible in context of plan it is defined for.

  • Method Details

    • server

      public BitbucketServerRepository server(@NotNull @NotNull ApplicationLink server)
      Selects Bitbucket Server instance which hosts this repository. The Bitbucket Server must be accessible from Bamboo via an application link.
      Parameters:
      server - Bitbucket Server instance
      See Also:
    • projectKey

      public BitbucketServerRepository projectKey(@NotNull @NotNull String projectKey)
      Sets key of Bitbucket Server's project which repository belongs to.
    • repositorySlug

      public BitbucketServerRepository repositorySlug(@NotNull @NotNull String repositorySlug)
      Sets the repository slug. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.

      To find out what is the repository slug of your repository, open it in Bitbucket Server UI and check the URL.

    • sshPublicKey

      public BitbucketServerRepository sshPublicKey(@NotNull @NotNull String sshPublicKey)
      Sets public SSH key of the repository.

      If specified, a private key should be specified as well.

      If not provided, Bamboo will attempt to generate and install new SSH keys into Bamboo Server instance. This property is required when using repository stored Specs feature.

    • sshPrivateKey

      public BitbucketServerRepository sshPrivateKey(@NotNull @NotNull String sshPrivateKey)
      Sets private SSH key of the repository. The key can be defined in both Bamboo-encrypted and plain format.

      If specified, a public key should be specified as well.

      If not provided, Bamboo will attempt to generate and install new SSH keys into Bamboo Server instance. This property is required when using repository stored Specs feature.

      See Also:
    • sshCloneUrl

      public BitbucketServerRepository sshCloneUrl(@NotNull @NotNull String sshCloneUrl)
      Sets repository url that is used for cloning the repository. Must be an ssh url. If not defined, the importer tries to fetch this value from Bitbucket. This property is required when using repository stored Specs feature.
    • branch

      public BitbucketServerRepository branch(@NotNull @NotNull String branch)
      Sets a branch to check out.
    • shallowClonesEnabled

      public BitbucketServerRepository shallowClonesEnabled(boolean useShallowClones)
      Enables/disables shallow clones when checking out from the repository. With shallow clones on, Bamboo 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 BitbucketServerRepository submodulesEnabled(boolean useSubmodules)
      Enables/disables submodule support. Turned off by default.
    • submodulesUseShallowClonesEnabled

      public BitbucketServerRepository submodulesUseShallowClonesEnabled(boolean useSubmodulesWithShallowClones)
      Enables/disables shallow clone support for submodules. Turned off by default.
    • sshKeyAppliesToSubmodules

      public BitbucketServerRepository sshKeyAppliesToSubmodules(boolean sshKeyAppliesToSubmodules)
      Enables/disabled authenticating to submodules with SSH key configured for this repository.
    • remoteAgentCacheEnabled

      public BitbucketServerRepository 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 BitbucketServerRepository commandTimeout(Duration commandTimeout)
      Specifies how much time is given for git commands to finish. Default is 180 minutes.
    • commandTimeoutInMinutes

      public BitbucketServerRepository commandTimeoutInMinutes(int commandTimeoutMinutes)
      Specifies how much time in minutes is given for git commands to finish. Default is 180 minutes.
    • verboseLogs

      public BitbucketServerRepository verboseLogs(boolean verboseLogs)
      Enables/disables verbose logs from git commands. Off by default.
    • fetchWholeRepository

      public BitbucketServerRepository fetchWholeRepository(boolean fetchWholeRepository)
      Enforces (or not) fetching all remote refs from the repository rather than single branch. Off by default.
    • lfsEnabled

      public BitbucketServerRepository lfsEnabled(boolean useLfs)
      Enables/disables git lfs support. Off by default.
    • defaultChangeDetection

      public BitbucketServerRepository defaultChangeDetection()
      Resets all change detection options to defaults.
    • changeDetection

      public BitbucketServerRepository changeDetection(@NotNull @NotNull VcsChangeDetection vcsChangeDetection)
      Sets change detection options for this repository.
      See Also:
    • mirror

      public BitbucketServerRepository mirror(@NotNull @NotNull BitbucketServerMirror mirror)
      Sets mirror to be used for cloning repository. Leave it empty if not using mirrors.
    • build

      Specified by:
      build in class VcsRepository<BitbucketServerRepository,BitbucketServerRepositoryProperties>