尝试从任何 REST 客户端触发 Jenkins 作业时出现以下错误
Authentication required <!-- You are authenticated as: anonymous Groups that you are in: Permission you need to have (but didn't): hudson.model.Hudson.Read ... which is implied by: hudson.security.Permission.GenericRead ... which is implied by: hudson.model.Hudson.Administer --> </body> </html>
从终端使用 curl 时触发请求
我正在使用以下语法
http://user:apiToken@jenkins.yourcompany.com/job/your_job/build?token=TOKEN [参考:https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients]
IE。curl -X POST http://user:apiToken@jenkins.yourcompany.com/job/your_job/build?token=TOKEN