Jenkins Remote Trigger Not Working

前端 未结 9 724
自闭症患者
自闭症患者 2021-02-03 22:54

I am getting the following error when i try triggering a build using the following command:

curl http://jenkins_server:port/jenkins/job/job_name/build?token=token_name

相关标签:
9条回答
  • 2021-02-03 23:34

    I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:

    curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>
    

    Use the same username and password you use to login to Jenkins. There was no need to install additional plugins.

    0 讨论(0)
  • 2021-02-03 23:35

    I suggest you try Jenkins Python API. It provides an build_job action that is super easy to trigger a job.

    build_job(name, parameters=None, token=None)
       Trigger build job.
    
       Parameters:  
       name – name of job
       parameters – parameters for job, or None, dict
       token – Jenkins API token
    
    0 讨论(0)
  • 2021-02-03 23:36

    On 1.625.3, giving Anonymous read access to almost everything worked for me.

    UPDATE: I guess I should clarify since this got downvoted. I was able to reproduce that error message, and when I turned on read access for the Anonymous user on all of the access types, it resolved the problem. Just saying...

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