-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: atlassian-bitbucket-server-integration-plugin
-
None
I recently had to switch from using GitSCM to BbS in the checkout commands in my multibranch pipeline script.
My GitSCM checkout looked like this:
Â
checkout( Â scm: Â Â [$class: 'GitSCM', Â Â Â branches: [[name: env.BRANCH_NAME]], Â Â Â userRemoteConfigs: [ Â Â Â Â [credentialsId: '<REDACTED>', Â Â Â Â Â refspec: "+refs/heads/${env.BRANCH_NAME}:refs/remotes/origin/${env.BRANCH_NAME}", Â Â Â Â Â url: '<REDACTED>'] Â Â Â ], Â Â Â extensions: [ Â Â Â Â [$class: 'RelativeTargetDirectory', relativeTargetDir: '<REDACTED>'], Â Â Â Â [$class: 'CloneOption', Â Â Â Â Â depth: 1, Â Â Â Â Â honorRefspec: true, Â Â Â Â Â noTags: true, Â Â Â Â Â reference: '<REDACTED>', Â Â Â Â Â shallow: true], Â Â Â Â [$class: 'SparseCheckoutPaths', Â Â Â Â Â sparseCheckoutPaths: sparseCheckoutPaths] Â Â Â ]])
Â
Â
And my BbS checkout looks like this:
checkout( Â BbS( Â Â id: '<REDACTED>', Â Â serverId: '<REDACTED>', Â Â credentialsId: '<REDACTED>', Â Â projectName: '<REDACTED>', Â Â repositoryName: '<REDACTED>', Â Â branches: [[name: env.BRANCH_NAME]], Â Â extensions: [ Â Â Â [$class: 'RelativeTargetDirectory', relativeTargetDir: '<REDACTED>'], Â Â Â [$class: 'CloneOption', Â Â Â Â depth: 1, Â Â Â Â noTags: true, Â Â Â Â reference: '<REDACTED>', Â Â Â Â shallow: true], Â Â Â [$class: 'SparseCheckoutPaths', Â Â Â Â sparseCheckoutPaths: sparseCheckoutPaths]]))
The BbS checkout is much slower than the GitSCM one, 1.5 min versus 9 sec, respectively. I believe this is because of the missing refspec in the BbS checkout. Tests with git on the command line have shown this to be true. Using a refspec greatly improves the checkout time.
Can support for refspecs be added to BbS? Am I missing how to do this with the existing functionality?
- is related to
-
JENKINS-67890 Specify a remote name different from the repository slug
-
- Open
-