一.Homebrew安装
我们使用命令安装Jenkins(这里我们不建议用安装包安装,因为有很多意想不到的坑),如果不安装brew,直接安装Jenkins的话,会报brew: command not found 。
Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。
- 终端中输入
- 安装
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 卸载
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
- 版本
brew -v
- 如果安装完成后还一直报brew: command not found
我们找到.bash_profile这个文件(配置各项路径的文件)中添加:
export PATH=/usr/local/bin:$PATH
然后卸载完重装,关了终端,再打开输入brew -v,就可以看到:
Homebrew 2.1.6
二.Jenkins安装
Jenkins 是一个开源项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能。
- 终端中输入
1.安装
brew install jenkins
2.链接 launchd 配置文件
ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents
3.配置完成,执行命令
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
4.命令行启动Jenkins
jenkins
5.打开浏览器,输入 localhost:8080 就可看到Jenkins的web界面
6.输入密码之后然后安装插件,我们先根据默认配置来安装就好了

7.重新打开localhost:8080,使用默认用户名和密码登录
用户名:admin
密码:和解锁Jenkins的密码一致

8.localhost:8080/exit退出Jenkins
三.部署Android自动打包环境
1.点击Manage Jenkins -> Configure System

















四.总结
花了一下午实现该项目,demo算是跑起来了,可能在理解上存在一点偏差,但是每一步都做好了记录,算是还比较完整吧,还有一些发送邮件等等的配置没写,因为题主暂时用不上,后续再补上,欢迎各位看官指出问题并与之讨论。
网友评论