Last active
July 28, 2020 16:57
-
-
Save rhopp/3b8664aa74be93c14d3edf74b75bdc6a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class | |
) | |
for (c in creds) { | |
println(c.id) | |
println(c.class) | |
if (c.properties.username) { | |
println(" description: " + c.description) | |
} | |
if (c.properties.username) { | |
println(" username: " + c.username) | |
} | |
if (c.properties.password) { | |
println(" password: " + c.password) | |
} | |
if (c.properties.passphrase) { | |
println(" passphrase: " + c.passphrase) | |
} | |
if (c.properties.secret) { | |
println(" secret: " + c.secret) | |
} | |
if (c.properties.privateKeySource) { | |
println(" privateKey: " + c.getPrivateKey()) | |
} | |
if (c instanceof org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl){ | |
println(" "+c.getContent().getText()); | |
} | |
if (c instanceof com.dabsquared.gitlabjenkins.connection.GitLabApiTokenImpl){ | |
println(" "+c.getApiToken()); | |
} | |
println("") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment