Created
January 11, 2021 21:19
-
-
Save opennomad/f83461e77944d31db682209ddf23b81c to your computer and use it in GitHub Desktop.
Validate a Jenkinsfile from the command line
This file contains 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 | |
# 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