Create jobs and execute them in jenkins using REST

前端 未结 5 1080
借酒劲吻你
借酒劲吻你 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 23:55

    See the Jenkins API Wiki page (including the comments at the end). You can fill in the gaps using the documentation provided by Jenkins itself; for example, http://JENKINS_HOST/api will give you the URL for creating a job and http://JENKINS_HOST/job/JOBNAME/api will give you the URL to trigger a build.

    I highly recommend avoiding the custom creation of job configuration XML files and looking at something like the Job DSL plugin instead. This gives you a nice Groovy-based DSL to create jobs programmatically - much more concise and less error-prone.

提交回复
热议问题