Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created August 29, 2019 16:46
Show Gist options
  • Save halkeye/9a00ea75897c4c0944651ad4edc2e83b to your computer and use it in GitHub Desktop.
Save halkeye/9a00ea75897c4c0944651ad4edc2e83b to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
set -x
# Assuming "anonymous read access" has been enabled on your Jenkins instance.
# JENKINS_URL=[root URL of Jenkins master]
JENKINS_URL=https://ci.blueocean.io
# JENKINS_URL=https://jenkins.gavinmogan.com
# JENKINS_CRUMB is needed if your Jenkins master has CRSF protection enabled as it should
JENKINS_CRUMB=`curl -qs "$JENKINS_URL/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)"`
curl -q -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<Jenkinsfile" $JENKINS_URL/pipeline-model-converter/validate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment