Skip to content

Instantly share code, notes, and snippets.

@opennomad
Created January 11, 2021 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opennomad/f83461e77944d31db682209ddf23b81c to your computer and use it in GitHub Desktop.
Save opennomad/f83461e77944d31db682209ddf23b81c to your computer and use it in GitHub Desktop.
Validate a Jenkinsfile from the command line
#!/bin/bash
# This script will send the Jenkinsfile in the current directory
# to the validation endpoint on a Jenkins server
# simply set and export the following variables, then run the script
# this will be something like "https://jenkins.yourdomain.com"
# export JENKINS_URL=''
# the username to connect to Jenkins as
# export JENKINS_USER=''
# the password or API key for the above user
# export JENKINS_PASS=''
curl --user "${JENKINS_USER}":"${JENKINS_PASS}" -X POST -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