安装
brew install jenkins
然后直接访问localhost:8080(别在后边加/jenkins)
修改端口号:
文件位置:
/usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist
<?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=127.0.0.1</string>
//修改这里
<string>--httpPort=8082</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
访问
localhost:8082
踩过的坑
- 直接运行jenkins,报错
解决方法:
别直接运行jenkins,通过brew启动:
brew services start jenkins
- Problem accessing /jenkins/. Reason: HTTP ERROR 404
解决方法:
直接访问 localhost:8080 (别在后边加/jenkins)
解决方法来自:https://blog.csdn.net/linrongxiao/article/details/80814131