最近在macOS上通过brew安装了jenkins-lts(2.263.4),发现通过"brew services start jenkins-lts"启动jenkins后,默认的监听IP是127.0.0.1,监听端口是8080,无法满足通过局域网访问Mac上部署的jenkins的需求,因此通过以下方式可以修改默认的启动参数:
1. 编辑"homebrew.mxcl.jenkins-lts.plist"文件:
vim /usr/local/Cellar/jenkins-lts/2.263.4/homebrew.mxcl.jenkins-lts.plist
2. 修改文件中的“httpListenAddress”以及"httpPort"参数:
3. 修改完成后,保存文件,重启jenkins:
% brew services restart jenkins-lts Stopping `jenkins-lts`... (might take a while) ==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts) ==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)