在通過curl來直接構建jenkins的時候,使用一下命令:
curl -X POST http://127.0.0.1:8080/job/test/build?delay=0sec
結果返回:403 no valid crumb was included in the request 這樣的錯誤提示
解決方法,使用如下命令:
curl -H 7a027c44-c69f-44ea-bcb4-564313a3c4c1 http://127.0.0.1:8080/job/test/build?delay=0sec
其中crumb的值(7a027c44-c69f-44ea-bcb4-564313a3c4c1)可在jenkins用戶管理頁面查看
參考地址:http://stackoverflow.com/questions/28577551/how-to-disable-a-jenkins-job-via-curl