Title: Message Title
Julio Gutierrez created an issue
Jenkins / JENKINS-40483
Jenkinsfile able to stop current job
Issue Type:
Improvement
Assignee:
Unassigned
Components:
pipeline
Created:
2016/Dec/15 4:25 PM
Environment:
org.jenkins-ci.main:jenkins-war:2.19.4
Labels:
pipeline
Priority:
Major
Reporter:
Julio Gutierrez
I want to be able to stop the current build. So for example, i want to run diff test on parallel stage('Test'){ parallel( "unit test": { try { /// run test! } finally{ if(currentBuild.result != 'SUCCESS') { //a test failed so build is unstable manager.build.doStop() // stop current build so the other tests that are currently running stop and release executors } } }, "integration test": {}, "js test": {}, . ) } in this particular scenario i would like to keep the current build status (unstable). ** right now if i try to do something like this i get org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method org.jenkinsci.plugins.workflow.job.WorkflowRun doStop at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:176) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:119) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) at WorkflowScript.run(WorkflowScript:24) at __cps.transform__(Nati