Validate Jenkinsfile vim function

Based on HTTP validate from

function! JenkinsLint() let jenkins_url = "https://MyJenkinsServer/jenkins" let crumb_command = "curl -s -k "".jenkins_url.'/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)"' let jenkins_crumb = system(crumb_command) let validate_command = "curl -k -X POST -H ".jenkins_crumb." -F "jenkinsfile=<".expand('%:p')."" ".jenkins_url."/pipeline-model-converter/validate" echo validate_command let result = system(validate_command) echo result endfunction 

Demo:

This sends your pipeline to your Jenkins server for validation before having to run the pipeline
Assuming "anonymous read access" has been enabled on your Jenkins instance.

submitted by
---