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('<Name of the job>').builds.findAll { it.number < 40 }.each { it.delete() } |
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
query { | |
repository(name:"awesome-podcasts", owner:"rShetty") { | |
content:object(expression:"master:README.md") { | |
... on Blob { | |
text | |
} | |
} | |
} | |
} |
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
/** | |
* Original script source: https://www.bonusbits.com/wiki/HowTo:Remove_Old_Job_Builds_on_Jenkins_with_Groovy_Script | |
*/ | |
import jenkins.model.* | |
import hudson.model.* | |
import com.cloudbees.hudson.plugins.folder.* | |
import jenkins.branch.* | |
import org.jenkinsci.plugins.workflow.job.* | |
import org.jenkinsci.plugins.workflow.multibranch.* |