Can I disable the job while it is in que waiting for build.
and
Can I delete my job from the que itself?
My Automation program is like this :
- Check for the job if currently executing .
- If not executing disable to job
- Delete the repository directory(maven based project) for that particular job , where it downloaded dependency jars.
- update the job (source) contents from version controller.
- Enable the job.
Example Scenario:
- Currently the job is not executing ,
- It is passed through Step 2 and disabled the job, but that job is in build queue.
- Started executing deleting the dependency files.
While executing step 3 , Build started from the queue and failed due to dependency not found and they are deleted from Step 3.
My Question is:
If the job is disabled and in build queue, will that job will be disabled or not ?
Will it be disabled from the next run?
In my scenario it is executing the job even it is disabled.
I haven’t found a way to actually disable a job. However, I found a way to check whether a job is in the build queue. Use the remote API, which gives you all the items currently in the build view. But I didn’t find a way to get all information to generate the cancel link.