-
Improvement
-
Resolution: Unresolved
-
Minor
-
atlassian-bitbucket-server-integration Plugin Version: 1.1.0
job-dsl Plugin version: 1.77
When testing out the new multibranch pipeline support in version 1.1.0 of the plugin, I discovered that creation of a multibranch pipeline job via Job DSL fails when the Jenkins root URL is not set. It seems that the plugin tries to register the webhook but does not catch the exception thrown when the Jenkins root URL is unset. Full stack trace: stack-trace.txt
Here is the Job DSL for the multibranch pipeline:
multibranchPipelineJob('test') { branchSources { branchSource { source { BbS { credentialsId('Build-User') id('test') mirrorName(null) projectName('TEST') repositoryName('test') serverId('Bitbucket') traits { cleanBeforeCheckoutTrait { extension { deleteUntrackedNestedRepositories(true) } } gitBranchDiscovery() localBranchTrait() pruneStaleBranchTrait() } } } } } }
The equivalent multibranch pipeline definition for the CloudBees Bitbucket Branch Source plugin gracefully handles the exception and skips webhook registration when the Jenkins root URL is unset. Example:
multibranchPipelineJob('test') { branchSources { branchSource { source { bitbucket { credentialsId('Build-User') id('test') repoOwner('TEST') repository('test') serverUrl('https://redacted.com/scm') traits { bitbucketBranchDiscovery { strategyId(1) } bitbucketPullRequestDiscovery { strategyId(1) } cleanBeforeCheckoutTrait { extension { deleteUntrackedNestedRepositories(true) } } localBranchTrait() pruneStaleBranchTrait() } } } } } }
- is related to
-
JENKINS-64801 Support for Job DSL
- Open