Create jobs and execute them in jenkins using REST

前端 未结 5 1167
借酒劲吻你
借酒劲吻你 2021-01-30 23:17

I am trying to create a WCF REST client that will communicate to Jenkins and create a job from an XML file and then build the job. My understanding is that you can do that with

5条回答
  •  灰色年华
    2021-01-30 23:54

    To create a job:

    curl -X POST -H "Content-Type:application/xml" -d "" -u username: API_Token http://JENKINS_HOST/createItem?name=AA_TEST_JOB2
    

    To build a job:

    curl -X POST -u username:API_TOKEN http://JENKINS_HOST/job/MY_JOB_NAME/build
    

提交回复
热议问题