Skip to content

Instantly share code, notes, and snippets.

@alipandidan
Created July 11, 2019 07:23
Show Gist options
  • Save alipandidan/c6981522f9af01adf83dc2ad13b9c8b0 to your computer and use it in GitHub Desktop.
Save alipandidan/c6981522f9af01adf83dc2ad13b9c8b0 to your computer and use it in GitHub Desktop.
List Jenkins Credentials
def StandardUsernameCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class, Jenkins.instance, null, null);
for (c in StandardUsernameCredentials) {
println(c.id + ": " + c.description)
}
def StandardUsernamePasswordCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials.class, Jenkins.instance, null, null);
for (c in StandardUsernamePasswordCredentials) {
println(c.id + ": " + c.description)
}
def IdCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.common.IdCredentials.class, Jenkins.instance, null, null);
for (c in IdCredentials) {
println(c.id + ": " + c.description)
}
def StandardCertificateCredentialsCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.common.StandardCertificateCredentials.class, Jenkins.instance, null, null );
for (c in StandardCertificateCredentialsCredentials) {
println(c.id + ": " + c.description)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment