Skip to content

Instantly share code, notes, and snippets.

@honnamkuan
Last active December 30, 2022 12:23
Show Gist options
  • Select an option

  • Save honnamkuan/ab750d387e4e2e3762907b98d408dcd0 to your computer and use it in GitHub Desktop.

Select an option

Save honnamkuan/ab750d387e4e2e3762907b98d408dcd0 to your computer and use it in GitHub Desktop.
List all Jenkins credentials
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.common.StandardCredentials.class,
Jenkins.instance,
null,
null
);
for (int i; i < creds.size(); i++) {
println "\n========== Credential ${i+1} Start =========="
creds[i].properties.each { println it }
println "========== Credential ${i+1} End ==========\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment