将gitlab与jenkins集成的例外情况

vsb*_*ere 9 jenkins gitlab gitlab-ci

我在私有Gitlab v9.0实例上创建并配置了一个项目.我已经在Jenkins v2.46.1上导入了这个项目,与gitlab的连接成功了.之后,我尝试在gitlab中从repo配置push事件的构建触发器.我已经在jenkins上为它生成了秘密令牌,并在我尝试测试webhook时添加了带有Gitlab CI URL和秘密令牌的webhook,它在异常下面返回了我

Hook executed successfully but returned HTTP 403 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Error 403 anonymous is missing the Job/Build permission</title> </head> <body><h2>HTTP ERROR 403</h2> <p>Problem accessing /project/tapp-builder-service. Reason: <pre> anonymous is missing the Job/Build permission</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/> </body> </html>
Run Code Online (Sandbox Code Playgroud)

有谁可以帮我解决这个问题?

lax*_*089 5

您可以为此在 Jenkins 中添加一个特殊用户并相应地在 GitLab 中配置 Webhook,或者您可以取消选中全局 Jenkins 配置的 GitLab 部分中的复选框“为‘/project’端点启用身份验证”。但默认情况下应取消选中此项。


Man*_*Ram 5

配置此功能的最佳方法是

  1. Jenkins 全局配置 ->

需要 /project 端点的授权 复制有权运行作业的 Jenkins 用户的用户 ID 和 API 密钥

  1. 在 GitLab 上创建一个 webhook 来触发作业

  2. 然后使用 HTTP 基本身份验证(以下格式):

http://用户:apikey@gitlab/project/jobname