Skip to content

Instantly share code, notes, and snippets.

@marcosborges
Created January 30, 2019 19:46
Show Gist options
  • Save marcosborges/d9b1e45c2da6998bcafee02125ede0e0 to your computer and use it in GitHub Desktop.
Save marcosborges/d9b1e45c2da6998bcafee02125ede0e0 to your computer and use it in GitHub Desktop.
import jenkins.model.Jenkins;
import com.cloudbees.plugins.credentials.*
import org.jenkinsci.plugins.plaincredentials.*
import org.jenkinsci.plugins.plaincredentials.impl.*
def _cred = CredentialsProvider.lookupCredentials(
Credentials.class,
Jenkins.getInstance(),
null,
null
)
for (c in _cred) {
if (c.getClass() == StringCredentialsImpl) {
println "${c.id} -> ${c.getSecret()}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment