Import jenkins job from XML file and curl

CURL

curl -s http://USERNAME:USER_API_TOKEN@localhost:8080/job/task1/config.xml | curl -X POST 'http://USERNAME:USER_API_TOKEN@localhost:8080/createItem?name=job1' --header "Content-Type: application/xml" -d @-

Jenkins-cli

java -jar jenkins-cli.jar -s http://localhost:8080/create-job NAME_OF_JOB < job.xml

Published by

Leave a Reply

Your email address will not be published. Required fields are marked *