Created
January 8, 2021 13:47
-
-
Save phgeraldeli/44ecce47c576119266ca61abc3d4a365 to your computer and use it in GitHub Desktop.
Jenkins credentials discover
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
// Execute in jenkins script console | |
String saida = new ProcessBuilder( 'sh', '-c',''' | |
grep -A4 CredentialName credentials.xml | tail -1 | cut -d'>' -f2 | cut -d'<' -f1 | |
''').redirectErrorStream(true).start().text | |
saida = saida.replaceAll('\\s','') | |
println( saida ) | |
println( hudson.util.Secret.decrypt(saida) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment