简体   繁体   English

如何通过代理在 jenkins 中配置“发送电子邮件”

[英]how to configure 'send email' in jenkins by proxy

My Jenkins machine cannot connect to the inte.net.我的 Jenkins 机器无法连接到 inte.net。 I want to configure Jenkins to work with a proxy server to send email. The startup parameter is:我想配置Jenkins配合代理服务器发送email,启动参数为:

-Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128

But it doesn't work.但它不起作用。

Jenkins proxy settings are configured on the Manage Jenkins > Manage Plugins > Advanced tab. Jenkins 代理设置在 Manage Jenkins > Manage Plugins > Advanced 选项卡上配置。

If you can't get to that page in your Jenkins instance you will need to ask the person with Admin access to that Jenkins instance.如果您无法访问 Jenkins 实例中的该页面,则需要询问对该 Jenkins 实例具有管理员访问权限的人员。

我通过在“/etc/default/jenkins”中的“JAVA_ARGS”设置中附加以下字符串来配置代理并重新启动 Jenkins 服务器。

 -Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128-Dhttps.proxyHost=172.16.0.10 -Dhttps.proxyPort=3128

You can configure the proxy properties on Manage Jenkins > System configurations.您可以在管理 Jenkins > 系统配置上配置代理属性。 In this page you can find "Global Properties" configuration and in this part you have to push the "add" button and put there the HTTP_PROXY, HTTPS_PROXY and NO_PROXY properties.在此页面中,您可以找到“全局属性”配置,在这部分中,您必须按下“添加”按钮并将 HTTP_PROXY、HTTPS_PROXY 和 NO_PROXY 属性放在那里。 These proxy properties should contain the proxy configuration like in the operating system.这些代理属性应该包含操作系统中的代理配置。 You can see an example of this configuration in the next image:您可以在下图中看到此配置的示例:

在此处输入图像描述

You should replace the properties:您应该替换属性:

  • <$PROTOCOL> -> Proxy address protocol (http, https, ...) <$PROTOCOL> -> 代理地址协议(http, https, ...)
  • <$USER> -> Proxy user authorization (If the proxy require it) <$USER> -> 代理用户授权(如果代理需要)
  • <$PASS> -> Proxy password (If the proxy require it) <$PASS> -> 代理密码(如果代理需要)
  • <$PROXY_DNS> -> Proxy URL or Proxy IP <$PROXY_DNS> -> 代理 URL 或代理 IP
  • <$PORT> -> Proxy port <$PORT> -> 代理端口
  • <$DNS1>,<$DNS2>,... -> URL where the proxy don't should be used <$DNS1>,<$DNS2>,... -> URL 不应使用代理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM