def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
Jenkins.instance,
null,
null
);
for (c in creds) {
println( ( c.properties.privateKeySource ? "ID: " + c.id + ", UserName: " + c.username + ", Private Key: " + c.getPrivateKey() : ""))
}
for (c in creds) {
println( ( c.properties.password ? "ID: " + c.id + ", UserName: " + c.username + ", Password: " + c.password : ""))
}
Last active
July 6, 2022 09:14
-
-
Save J00MZ/60bc74bdf4d5a7078f0881c167dfe208 to your computer and use it in GitHub Desktop.
Jenkins_Get_Secrets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment