通过jenkins.pkg程序安装
1.修改环境配置
编辑 vi ~/.bash_profile,添加命令别名:
alias jk_start="sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist"#启动Jenkins
alias jk_stop="sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist"#停止Jenkins
alias ci_mod_httpPort="sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 9090"#修改Jenkins监听端口号为9090
alias ci_uninstall="/Library/Application\ Support/Jenkins/Uninstall.command"#卸载Jenkins
alias ci_read="defaults read /Library/Preferences/org.jenkins-ci"
最后加载source ~/.bash_profile生效即可
项目基本配置:
首次登录时,需要输入密码,密码文件在:/Users/Shared/Jenkins/Home/secrets/initialAdminPassword 目录里(页面有提示)
PS:遇到一个问题就是启动了rethinkdb默认占用了8080端口……然后又没修改jenkins的默认端口,导致访问时一直显示异常。
1.构建时提示无访问权限无法执行mkdir创建目录,给对应目录授权即可:sudo chmod -R 777 /Users/sylcj1314/sites
INTERNALERROR> File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 220, in makedirs INTERNALERROR> mkdir(name, mode) INTERNALERROR> PermissionError: [Errno 13] Permission denied: '/Users/sylcj1314/sites/compzbcq/reports' Build step 'Execute shell' marked build as failure
2.进入插件管理页面报错解决:
进入插件管理->Advanced,修改Update Site的URL,路径为“http://updates.jenkins.io/update-center.json”,修改完成,submit,然后checknow
3.中文设置:
进入插件管理下载并安装:Localization: Chinese (Simplified) 这个插件,重启Jenkins即可生效