Guest User

Untitled

a guest
Mar 5th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. String getJFrogPasswordFromSystemKeyring() {
  2. def stdout = new ByteArrayOutputStream()
  3. def stderr = new ByteArrayOutputStream()
  4. exec {
  5. commandLine 'secret-tool', 'lookup', 'server', 'git.company.ch'
  6. standardOutput = stdout
  7. errorOutput = stderr
  8. ignoreExitValue = true
  9. }
  10.  
  11. return stdout.toString().trim()
  12. }
  13.  
  14. ext.jFrogUser = project.properties["jFrogUser"]
  15. if (project.hasProperty("jFrogPassword")) {
  16. println("Reading jFrog password from gradle.properties")
  17. ext.jFrogPassword = project.properties["jFrogPassword"]
  18. } else {
  19. println("Reading jFrog password from keyring")
  20. ext.jFrogPassword = getJFrogPasswordFromSystemKeyring()
  21. }
Add Comment
Please, Sign In to add comment