Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jenkins credentials obtain on script console
com.cloudbees.plugins.credentials.SystemCredentialsProvider.getInstance().getCredentials().forEach{
it.properties.each { prop, val ->
if (prop == "secretBytes") {
println(prop + "=>\n" + new String(com.cloudbees.plugins.credentials.SecretBytes.fromString("${val}").getPlainData()) + "\n")
} else {
println(prop + ' = "' + val + '"')
}
}
println("-----------------------")
}
// Idea taken from https://devops.stackexchange.com/a/8692/19764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment