Last active
July 29, 2019 15:25
-
-
Save solocommand/23fe345f420db3de890e648b6f9b289c to your computer and use it in GitHub Desktop.
Dump Jenkins credentials
This file contains 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
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.plugins.credentials.impl.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
import org.jenkinsci.plugins.plaincredentials.impl.* | |
domain = Domain.global() | |
store = SystemCredentialsProvider.getInstance().getStore() | |
for (credential in store.getCredentials(domain)) { | |
try { | |
println credential.getId() + " " + credential.getUsername() + " " + credential.getPassword().getPlainText() | |
} catch (e) { | |
println credential | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment