Created
July 10, 2019 08:51
-
-
Save balcsida/f4a3a9cf8759afabdc73d412ac5cd87f to your computer and use it in GitHub Desktop.
Dump the properties of all credential objects
This file contains 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.plugins.credentials.Credentials | |
import com.cloudbees.plugins.credentials.CredentialsProvider | |
import com.cloudbees.hudson.plugins.folder.Folder | |
Set<Credentials> credentials = | |
CredentialsProvider.lookupCredentials(Credentials.class) | |
Jenkins.instance.getAllItems(Folder.class).each { folder -> | |
credentials.addAll( | |
CredentialsProvider.lookupCredentials(Credentials.class, folder) | |
) | |
} | |
credentials.each { credential -> | |
println credential.properties | |
} | |
null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment