如何连接詹金斯和吉埃塔 [英] How to connect Jenkins and Gieta

查看:148
本文介绍了如何连接詹金斯和吉埃塔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我想在我的Gitea Repo和Jenkins之间建立CI/CD管道.到目前为止,我已经使用针对詹金斯的Gitea API创建了一个Webhook. 不幸的是,当我尝试将测试包从Gitea发送到Jenkins时,出现x509错误,说证书无效

I have the problem, that I want to establish a CI/CD Pipeline between my Gitea Repo and Jenkins. So far I created a webhook with the Gitea API to Jenkins. Unfortunatly, when I try to send test packages from Gitea to Jenkins, I get the x509 Error, saying that the Certificates are not valid

交付:发布https://*************/jenkins:x509:证书对xxxxxxxxxxxxx有效,而不是yyyyyyyyyyyyyy

Delivery: Post https://*************/jenkins: x509: certificate is valid for xxxxxxxxxxxxx, not yyyyyyyyyyyyyyyy

另一方面,我无法在詹金斯Web UI中添加我的gitea服务器.如果尝试这样做,则会收到一条错误消息,指出无法建立连接,原因是:

On the other Hand I cant add my gitea Server in the Jenkins web UI. If I try to do so, I receive an error saying that The connection cannot be established because:

无法与服务器通信:HTTP 403/禁止访问

Could not communicate with server: HTTP 403/Forbidden

我现在很绝望.我已经尝试将Certs添加到Jenkins正在运行的计算机上,以消除x509错误,但是它没有帮助. 另外,如果我尝试添加正式的try.gitea.io服务器而不是我的服务器,它实际上可以工作.但是我在配置中添加了服务器,因此使用官方服务器不是可选的.

I am quite desperate by now. I already tried to add Certs to the machine Jenkins is running on, to eliminate the x509 error, but it didnt help. Also if I try to add instead of my server the official try.gitea.io Server, it actually works. But I nedd my server in the config, so it´s not optional to use the official one.

先谢谢了.

推荐答案

我在带有Gitea插件版本1.1.2的Docker容器中使用Jenkins版本2.190.2 runnin.

I use Jenkins Version 2.190.2 runnin in Docker container with Gitea Plugin Version 1.1.2.

我看到与消息相同的问题

I see the same problem with the message

无法与服务器通信:HTTP 403/禁止访问

Could not communicate with server: HTTP 403/Forbidden

Jenkins>管理Jenkins>配置系统> Gitea服务器

Jenkins > Manage Jenkins > Configure System > Gitea Servers

当我将服务器URL设置为具有https协议的Gitea服务器时(例如,服务器URL:https://gitea.mycompany.com和名称:mycompany_gitea)

when I set the Server URL to a Gitea server with the https protocol (e.g. Server URL: https://gitea.mycompany.com and Name: mycompany_gitea)

我试图通过keytool将gitea.company.com的证书添加到Jenkins JVM的受信任证书中,但是没有成功(考虑gitea.company.com的ssl证书是全局受信任的证书,而不是本地生成的或私人证书).

I have tried to add the certificate of gitea.company.com to the trusted certificates of the Jenkins JVM by means of the keytool, but no success (consider the ssl certificate of gitea.company.com is a globally trusted certificate and not a locally generated or private certificate).

最后,我尝试通过添加新的Gitea组织文件夹

In the end I tried to add new Gitea Organization Folder by

Jenkins>新产品> Gitea Organization(名称例如mycompany)

Jenkins > New Item > Gitea Organization (with name e.g. mycompany)

尽管出现问题消息.

我在"Gitea组织"下为新的Gitea组织项目配置了以下值:

I configured the new Gitea Organization project under 'Gitea Organization' with following values:

  • 服务器:mycompany_gitea
  • 凭证:(有权访问所有Gitea/git存储库的Gitea用户的詹金斯凭证)
  • 所有者:(Gitea组织/用户名)

然后……塔达!有用!现在,我可以毫无问题地扫描Gitea组织.

and... Ta-dah! It works! I can without any problems Scan the Gitea Organization now.

因此似乎是消息

无法与服务器通信:HTTP 403/禁止访问

Could not communicate with server: HTTP 403/Forbidden

是一种假阳性",可以忽略不计...

is a kind of "false positive" and can be ignored...

考虑消息

交付:发布https://*************/jenkins:x509:证书对xxxxxxxxxxxxx有效,而不是yyyyyyyyyyyyyy

Delivery: Post https://*************/jenkins: x509: certificate is valid for xxxxxxxxxxxxx, not yyyyyyyyyyyyyyyy

通过与Jenkins的集成,我遇到了相同的错误.问题是Gitea不支持证书发现"功能(例如,像Firefox这样的浏览器,

I had the same error by the integration with Jenkins. The problem was that Gitea does not support the "certificate discovery" feature (as for example a browser like Firefox does, see) and Jenkins was misconfigured and was sending only the end entity certificate.

让Jenkins发送整个证书链后,问题消失了.

After making Jenkins to send the entire certificate chain, the problem disappeared.

这篇关于如何连接詹金斯和吉埃塔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆