Mac安装部署Jenkins

提醒:强烈建议使用命令行进行安装,使用安装包dmg安装会有很多权限问题无法解决

PS:很久以前安装的,对JDK的要求忘记了,应该是需要JDK1.8,如果配置不成功,可以尝试配置JDK1.8后再尝试

step1:安装homebrew(已安装的跳过此步骤)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

step2:安装Jenkins

brew install jenkins

step3:链接launchd配置文件

ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents

step4:开启和关闭jerkins服务。两种方法:
1、启动jenkins:launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
关闭Jenkins:launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
2、启动:brew services start jenkins
关闭:brew services stop jenkins
重启:brew services restart jenkins

step5:访问Jenkins
浏览器输入:http://localhost:8080,之后的流程和Windows一致,参考我的另一篇:https://blog.csdn.net/MDMsusu/article/details/106782580

踩坑:
1、brew安装jenkins会避免很多其他安装方式产生的用户权限问题,但会将httpListenAddress默认设置为127.0.0.1,这样我们虽然可以在本地用localhost:8080访问,但是本机和局域网均无法用ip访问。
解决办法为修改两个路径下的plist文件中的httpListenAddress后的ip地址,修改为本机IP或者0.0.0.0即可,然后重启:

~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
/usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值