Throttle Concurrent BuildsプラグインでJenkinsを使用しており、jenkins構成にThrottle Categoryを追加しようとしています(Jenkins => Jenkinsの管理=> Systemの構成=>Throttle Concurrent Builds)。groovy を使用して構成することは可能ですか? ありがとう。
1 に答える
3
String expectedLabel = "testLabel";
Integer expectedMax = new Integer(1);
ThrottleJobProperty.ThrottleCategory category =
new ThrottleJobProperty.ThrottleCategory('testCategoryName3', 0, 0, null);
List<ThrottleJobProperty.NodeLabeledPair> nodeLabeledPairs = category.getNodeLabeledPairs();
nodeLabeledPairs.add(new ThrottleJobProperty.NodeLabeledPair(expectedLabel, expectedMax));
ThrottleJobProperty.DescriptorImpl descriptor = Jenkins.getInstance().getDescriptorByType(ThrottleJobProperty.DescriptorImpl.class)
categories = descriptor.getCategories()
categories.add(category)
descriptor.save()
于 2016-01-22T13:58:39.927 に答える