Trigger build via URL gives me no crumb included in request error

后端 未结 2 735
时光取名叫无心
时光取名叫无心 2021-01-21 05:19

I\'ve been trying to trigger a build via the Jenkins API so far with no success. I configured a job on \'Trigger builds remotely\' and set a token, \'abc\'.

Then in post

2条回答
  •  悲哀的现实
    2021-01-21 05:35

    This worked for me:

    Obtain crumb

    $ wget -q --auth-no-challenge --user yourUserName --password yourPassword--output-document - 'http://myJenkins:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)'

    Now run the Jenkins job

    $ curl -I -X POST http://yourUserName:yourPassword@myJenkins:8080/job/JOBName/build -H "Jenkins-Crumb:44e7038af70da95a47403c3bed5q10f8"

    HTTP/1.1 201 Created 
    Date: Fri, 28 July 2017 09:15:45 GMT
    X-Content-Type-Options: nosniff 
    Location: http://myJenkins:8080/queue/item/17/
    Content-Length: 0
    

提交回复
热议问题