Jenkins 如何使用脚本添加多项目限制类别
我正在使用Jenkins with Throttle Concurrent Builds插件,并尝试在Jenkins配置中添加Throttle类别(Jenkins=>manage Jenkins=>Configure System=>Throttle Concurrent Builds)。是否可以使用groovy对其进行配置?谢谢。Jenkins 如何使用脚本添加多项目限制类别,jenkins,jenkins-plugins,throttling,jenkins-groovy,Jenkins,Jenkins Plugins,Throttling,Jenkins Groovy,我正在使用Jenkins with Throttle Concurrent Builds插件,并尝试在Jenkins配置中添加Throttle类别(Jenkins=>manage Jenkins=>Configure System=>Throttle Concurrent Builds)。是否可以使用groovy对其进行配置?谢谢。String expectedLabel=“testLabel”; String expectedLabel = "testLabel"; Integer exp
String expectedLabel=“testLabel”;
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()
整数expectedMax=新整数(1);
ThrottleJobProperty.ThrottleCategory类别=
新的ThrottleJobProperty.ThrottleCategory('testCategoryName3',0,0,null);
List nodeLabeledPairs=category.getNodeLabeledPairs();
添加(新的ThrottleJobProperty.NodeLabeledPair(expectedLabel,expectedMax));
ThrottleJobProperty.DescriptorImpl descriptor=Jenkins.getInstance().getDescriptorByType(ThrottleJobProperty.DescriptorImpl.class)
categories=descriptor.getCategories()
类别。添加(类别)
descriptor.save()