Triggering builds remotely in Jenkins

前端 未结 2 384

I had tried to trigger my Jenkins project by using this URL in my commit hook

curl http://jenkins_server/job/job_name/build?token=TOKEN

and is

相关标签:
2条回答
  • 2021-01-24 16:06

    Does the server running curl have a hosts/DNS entry back to jenkins_server?

    0 讨论(0)
  • 2021-01-24 16:13

    First, as Electrawn suggested, verify that the server where the commit hook is running can actually reach Jenkins DNS. A simple ping or curl to the root address (i.e. http://jenkins_server) would suffice

    Secondly, if your Jenkins does not allow anonymous read access and build triggering (and most installations won't) your issue is that your curl call is not logged in. In your browser, try logging out from Jenkins and then going to the same URL. Does that work? Probably not.

    To pass login credentials with curl, have a read here: How can a Jenkins user authentication details be "passed" to a script which uses Jenkins API to create jobs?

    More succinct answer here

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