Created
June 18, 2019 18:19
-
-
Save guitarmanvt/b06dcce1507386b6638b1a9ccaddc7d9 to your computer and use it in GitHub Desktop.
Jenkinsfile linter
This file contains hidden or 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
#!/bin/bash | |
src="${1:-Jenkinsfile}" | |
JENKINS_URL="https://jenkins.example.com" | |
function lint() { | |
JENKINS_CRUMB=$(curl --user USERNAME:PASSWORD -k "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)") | |
curl --user USERNAME:PASSWORD -k -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<${src}" $JENKINS_URL/pipeline-model-converter/validate | |
} | |
lint 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment