snippets > validate-jenkinsfile-before-running-using-terminal

November 12, 2020

Validate a Jenkinsfile without running it

Jenkins servers have a simple validator to check build files for basic errors without running them. Let’s use curl to send a local file named MyJenkinsfile:

curl --user "<username>:<password>" -X POST -F "jenkinsfile=<MyJenkinsfile" https://<jenkins_host_address>/pipeline-model-converter/validate

The response body will contain validation info.