This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: Nevigate to *https://<Jenkins_URL>/script* URL | |
Step 2: Run below script from script console one by one. | |
I) Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob.class).each {i -> i.setDisabled(true); i.save() } | |
II) Jenkins.instance.getAllItems(hudson.model.AbstractProject.class).each {i -> i.setDisabled(true); i.save()} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check to see if your jenkins home is in | |
# /var/lib/jenkins. If it isn't, then modify the script | |
# This will traverse through all your jobs, and disable them. | |
cd /var/lib/jenkins/jobs | |
for d in */ ; do | |
cd "$d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jenkins.instance.getItemByFullName("<project-name>/<branch-name>") | |
.getBuildByNumber(JobNumber) | |
.finish(hudson.model.Result.ABORTED, | |
new java.io.IOException("Aborting build") | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jenkins.instance | |
.getItemByFullName("<JOB NAME>") | |
.getBranch("<BRANCH NAME>") | |
.getBuildByNumber(<BUILD NUMBER>) | |
.finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build")); |