[Jenkins] 局域网无法根据 ip 访问 jenkins

配置

  • brew install jenkins 使用brew 安装的 jenkins

解决方案

修改 homebrew.mxcl.jenkins.plisthttpListenAddress0.0.0.0

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.jenkins</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/libexec/java_home</string>
      <string>-v</string>
      <string>1.8</string>
      <string>--exec</string>
      <string>java</string>
      <string>-Dmail.smtp.starttls.enable=true</string>
      <string>-jar</string>
      <string>/usr/local/opt/jenkins/libexec/jenkins.war</string>
      <string>--httpListenAddress=0.0.0.0</string>
      <string>--httpPort=8080</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

路径:

  • ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
  • /usr/local/Cellar/jenkins/版本号/homebrew.mxcl.jenkins.plist

重启

brew services stop jenkins
Stopping `jenkins`... (might take a while)
==> Successfully stopped `jenkins` (label: homebrew.mxcl.jenkins)
brew services start jenkins
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
    原文作者:manajay
    原文地址: https://www.jianshu.com/p/10041e79ac6f
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞