Jenkins笔记
目录
1、homebrew
安装的Jenkins
无法通过IP
访问
这是因为brew
把jenkins
启动的监听地址设置为了127.0.0.1
,改为0.0.0.0
即可实现访问
jenkins
配置所在路径:~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
2、jenkins
脚本中无法使用pod
、brew
等命令
需要在脚本开头添加 -l
|
|
3、构建中生成的数据无法传递给构建阶段
解决:把数据写入文件,然后通过Jenkins种的FILE
获取
写文件
|
|
读文件
|
|
4、自动输入
比如自动输入 Y
|
|
5、填充密码
使用echo
加 -S
解决
|
|
6、从构建日志中过滤日志
比如修改构建名称和构建描述
|
|
获取登录用户名的另一种方式,需要打开Set jenkins user build variables
|
|
Jenkins插件推荐
插件镜像: http://mirror.esuni.jp/jenkins/updates/update-center.json
- Blue Ocean
- Pipeline
- Priority Sorter Plugin
- Extented Choice Parameter Plugin-In
- Git Parameter Plug-In
- List Git Branches Parameter
- Environment Injector
- Credentials Plugin
- CocoaPods Jenkins Integration
- Keychains and Provisioning Profiles Management
- Xcode Integration
- Safe Restart Plugin
Shell Tips:
-
执行出错时自动执行后面的命令(
||
):xcodebuild archive || echo "执行失败"
-
设置默认值:
PROJECT_DIR=${project_path:-$WORKSPACE}
#如果参数未设置取默认值