jenkinsci / jenkinsci/branch-api-plugin
[JENKINS-63817] buildStrategies are not set when using jobDSL,
- Dominant language
- Java
- Stars
- 39
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Given this jobDSL definition:
multibranchPipelineJob("${args.jobName}") {
description("Multibranch job")
branchSources{
branchSource {
source {
github {
id("${args.jobName}-gh-branches-1")
scanCredentialsId("####")
checkoutCredentialsId("####")
repoOwner('####')
repository("${args.repositoryName}")includes("main jira-*")
}
}
buildStrategies {
includeRegionBranchBuildStrategy {
includedRegions("${args.project}/**")
}
}
}
}
factory {
workflowBranchProjectFactory {
scriptPath("${args.project}/Jenkinsfile")
}
}
}
The generated jobs have no build strategy set: 
The multibranch-build-strategy-extension plugin is installed (same result using strategies from basic-branch-build-strategies plugin) and I can manually add the strategy.
---
Originally reported by
aitorpazos, imported from: buildStrategies are not set when using jobDSL,
Raw content of original issue
Given this jobDSL definition:
multibranchPipelineJob("${args.jobName}") {
description("Multibranch job")
branchSources{
branchSource {
source {
github {
id("${args.jobName}-gh-branches-1")
scanCredentialsId("####")
checkoutCredentialsId("####")
repoOwner('####')
repository("${args.repositoryName}")includes("main jira-*")
}
}
buildStrategies {
includeRegionBranchBuildStrategy {
includedRegions("${args.project}/**")
}
}
}
}
factory {
workflowBranchProjectFactory {
scriptPath("${args.project}/Jenkinsfile")
}
}
}The generated jobs have no build strategy set:
The multibranch-build-strategy-extension plugin is installed (same result using strategies from basic-branch-build-strategies plugin) and I can manually add the strategy.
1 attachment
- [image-2020-09-30-09-33-41-452.png](https://issues.jenkins.io/secure/attachment/52728/image-2020-09-30-09-33-41-452.png)
> 
Contributor guide
Assessment
This issue has not been assessed yet.