I currently have this:
multibranchPipelineJob("myjob") {
branchSources {
branchSource {
source {
bitbucket {
credentialsId('bitbucket-login-user-pass')
repoOwner('myteam')
repository('myrepo')
autoRegisterHook(true)
}
}
}
}
}
But I also need to add the following settings:
How do I add these settings in the config? Are they "traits" where do I go to see what traits I have available?
I tried using originPullRequestDiscoveryTrait but I get: ERROR: Found multiple extensions which provide method originPullRequestDiscoveryTrait with arguments [script$_run_closure1$_closure3$_closure4$_closure5$_closure6$_closure7$_closure8@3ae03409]: [[com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait, org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait]]
This doesn't seem to work:
traits {
// discover PRs
//BranchDiscoveryTrait {
// strategyId(1) // Exclude branches that are also filed as PRs
// //strategyId(2) // Only branches that are also filed as PRs
// //strategyId(3) // All branches
//}
//ForkPullRequestDiscoveryTrait {
// strategyId(1) //
// //strategyId(2) //
// //strategyId(3) //
//}
originPullRequestDiscoveryTrait {
strategyId(1) // Merging the pull request with the current target branch revision
//strategyId(2) // The current pull request revision
//strategyId(3) // Both the current pull request revision and the pull request merged with the current target branch revision
}
}
--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/6cff6a7e-241c-479e-ac78-218799e27102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<com.cloudbees.jenkins.plugins.bitbucket.WebhookRegistrationTrait>
<mode>ITEM</mode>
</com.cloudbees.jenkins.plugins.bitbucket.WebhookRegistrationTraitconfigure { def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits traits << 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait' { strategyId(1) // detect all branches -refer the plugin source code for various options } traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' { strategyId(1) } traits << 'com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait' { strategyId(1) } traits << 'com.cloudbees.jenkins.plugins.bitbucket.WebhookRegistrationTrait' { mode(ITEM) } }