Skip to content

Instantly share code, notes, and snippets.

View syedsfayaz's full-sized avatar

FayazHussain Sayyed syedsfayaz

View GitHub Profile
@syedsfayaz
syedsfayaz / extract-credentials.groovy
Created September 24, 2021 01:36 — forked from pedrohdz/extract-credentials.groovy
Export credentials for Jenkins Configuration as Code (JCasC)
// This Jenkins Groovy script extracts credentials in Jenkins and outputs them
// in a JSON format that can be digested by "Jenkins Configuration as Code".
// Just pass the output into a JSON to YAML converter. You can run this
// through the Jenkins Script Console or similar.
//
// Thank you:
// - https://github.com/tkrzeminski/jenkins-groovy-scripts/blob/master/show-all-credentials.groovy
//
// To conver to YAML `json2yaml | sed '/^[[:space:]]*$/d'`
//