如何使用jenkinsapi进行身份验证和触发构建?

时间:2018-12-26 14:43:57

标签: jenkins-api

我正在尝试使用jenknis api触发带有paramateres的构建,但是我得到了身份验证异常。

这是我的代码:

import jenkins

    crumb = CrumbRequester(baseurl=url, username=userName,
                           password=pswd, ssl_verify=False)

    jenkins_server = Jenkins(url, username=userName,
                                  password=pswd, requester=crumb, ssl_verify=True)


    jenkins_server.build_job("jobName", json_content)

例外是:

Authentication required\n<!--\nYou are authenticated as: anonymous\nGroups that you are in:\n  \nPermission you need to have (but didn't): hudson.model.Item.Build\n ... which is implied by: hudson.security.Permission.GenericUpdate\n ... which is implied by: hudson.security.Permission.GenericWrite\n ... which is implied by: hudson.model.Hudson.Administer\n-->\n\n</body></html>  

我想念什么?

谢谢!

0 个答案:

没有答案