How To Disable One Jenkins Job
- Get breadcrumb
curl -u “<user>:<password>“ ‘https://<jenkins_url>/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,”:”,//crumb)’
-
curl -I -X POST https://<jenkins_url>/<job_path>/disable –user <user>:<password> -H “<jenkins bread crumb>”
How To Disable Jenkins jobs Under A Folder
- Via Jenkins script
https://<jenkins_url>/script
- Enter the following in the script and execute it
folderName=”Build/APP/test” //full name of the folder you want to disable all jobs in
Jenkins.instance.getItemByFullName(folderName).allJobs
.each {
it.setDisabled(true)
println(“Disabled job: [$it.fullName]”)
}
null
Note: Look for file structure in server, ignore the “jobs” path in URL
Leave a Reply