Created
August 11, 2022 18:18
-
-
Save thorntonrose/20f3fe496474bfa8f72069998d646faf to your computer and use it in GitHub Desktop.
Run Jenkins script remotely
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
COOKIE_JAR=/tmp/cookies | |
CRUMB=$(curl -s --cookie-jar $COOKIE_JAR -u $JENKINS_USER:$JENKINS_TOKEN $JENKINS_URL/crumbIssuer/api/json | \ | |
jq -r .crumb) | |
curl -i --cookie $COOKIE_JAR -u $JENKINS_USER:$JENKINS_TOKEN \ | |
-H "Jenkins-Crumb:${CRUMB}" -d "script=println 'foo'" \ | |
$JENKINS_URL/scriptText \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment