Calling a Jenkins build from outside of Jenkins?

后端 未结 10 2069
刺人心
刺人心 2020-11-27 15:49

I am new to Jenkins, and I\'m not sure if this is possible, but I would like to set up a web interface where somebody could click \"Start Job\" and this will tell Jenkins to

相关标签:
10条回答
  • 2020-11-27 16:30

    Jenkins has a documented REST API. You can make your little web service invoke it.

    0 讨论(0)
  • 2020-11-27 16:32

    Jenkins has support for parameterized build as well.

    So, if you want to pass parameters for configurable build generation, you can pass them by posting it while invoking Jenkins build request with http://YOURHOST/jenkins/job/PROJECTNAME/buildWithParameters.

    0 讨论(0)
  • 2020-11-27 16:44

    With curl if you have multiple arguments to pass like a token and a parameter you might have to quote on Linux shell:

    curl -H POST "http://USERNAME:PASSWORD@JENKINS_HOST:PORT/job/JOB_NAME/build?token=YOUR_TOKEN&PARAMETER=VALUE"
    
    0 讨论(0)
  • 2020-11-27 16:48

    Use:

    http://some server/job/myjob/buildWithParameters?token=TOKEN&PARAMETER=Value
    

    You can take a look at this documentation: Parameterized Build

    0 讨论(0)
提交回复
热议问题