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
import com.cloudbees.plugins.credentials.CredentialsProvider | |
import com.cloudbees.plugins.credentials.Credentials | |
import com.cloudbees.plugins.credentials.domains.Domain | |
import jenkins.model.Jenkins | |
def indent = { String text, int indentationCount -> | |
def replacement = "\t" * indentationCount | |
text.replaceAll("(?m)^", replacement) | |
} | |
Jenkins.get().allItems().collectMany{ CredentialsProvider.lookupStores(it).toList()}.unique().forEach { store -> |
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
cd $JENKINS_HOME | |
mkdir -p init.groovy.d/ | |
#see https://www.jenkins.io/doc/book/managing/groovy-hook-scripts/ | |
#open file with vi | |
vi init.groovy.d//init.groovy | |
#add the follwing and save | |
#init.groovy |
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
2024-03-25,10:53:31 | |
2024-03-25,10:53:32 |
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
import jenkins.model.Jenkins | |
import com.cloudbees.hudson.plugins.folder.Folder | |
import hudson.triggers.TimerTrigger | |
def listAllJobs(folder, indent = "") { | |
folder.getItems().each { item -> | |
if (item instanceof Folder) { | |
// Print folder name and recurse into subfolder | |
println "${indent}Folder: ${item.fullName}" | |
listAllJobs(item, indent + " ") | |
} else { |
OlderNewer