use of jenkins.branch.BranchBuildStrategy in project gitlab-branch-source-plugin by Argelbargel.
the class GitLabSCMItemListener method updateBranchBuildStrategies.
private boolean updateBranchBuildStrategies(MultiBranchProject<?, ?> project) {
boolean changed = false;
for (BranchSource branchSource : project.getSources()) {
if (GitLabSCMBranchBuildStrategy.INSTANCE.isApplicable(branchSource)) {
List<BranchBuildStrategy> strategies = new ArrayList<>(branchSource.getBuildStrategies());
if (!strategies.contains(GitLabSCMBranchBuildStrategy.INSTANCE)) {
strategies.add(GitLabSCMBranchBuildStrategy.INSTANCE);
branchSource.setBuildStrategies(strategies);
changed = true;
}
}
}
return changed;
}
Aggregations