Search code examples
jenkinspost-build

Delete jenkins project after build


A user is able to create jenkins jobs from the application in order to schedule an action.

I would like to know if it's possible to delete a jenkins project after the build has been executed. There is the Post-build action "delete workspace when build is done" but it only deletes the workspace, not the project.


Solution

  • It should be possible with an HTTP POST

    http:///jenkinsServer/job/yourJob/doDelete
    

    Look at http://jenkinsServer/job/YourJob/api/?

    Delete a job

    To programmatically delete this job, do HTTP POST to this URL.