我在Jenkins的Build Executor Status面板中单击它名称旁边的[x]按钮中止了一个作业,但是该作业仍然存在并等待.
即使我重新启动Jenkins,它也会重新开始构建.当我看一下控制台时,我看到:
Sending interrupt signal to process Click here to forcibly terminate
running steps java.io.IOException: Aborting build at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at Script1.run(Script1.groovy:1) at
groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) [SNIP]Finished: ABORTED Resuming build at Tue Oct 25 14:56:36 CDT 2016 after
Jenkins restart
我相信我的Pipeline脚本的这个版本还包括一个“输入”块,它可能会因为等待输入而中止,如果它有所作为
最佳答案 我通过管理Jenkins清理这些 – >脚本控制台然后输入如下代码:
Jenkins.instance.getItemByFullName(
“TPR-额日格”)
.getBuildByNumber(24).
完成(hudson.model.Result.ABORTED,
new java.io.IOException(“Aborting build”));
注意:以上内容可能需要在脚本控制台中全部放在一行