Created
August 8, 2018 01:29
-
-
Save rubberduck203/604822a166249d761b0c28d0cceefc5b to your computer and use it in GitHub Desktop.
Decrypt Jenkins Secret
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
// Run in the Jenkins script console | |
// https://stackoverflow.com/questions/37683143/extract-passphrase-from-jenkins-credentials-xml | |
// file containing value without surrounding curly braces | |
File file = new File("/path/to/file.txt") | |
hudson.util.Secret.decrypt("{${file.text}}") | |
// file with value including curly braces | |
File file = new File("/path/to/file.txt") | |
hudson.util.Secret.decrypt(file.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment