【Mac】解决jenkins执行shell脚本等场景中遇见的权限不足问题
一、问题描述在Mac上使用jenkins的过程里,执行某些shell脚本时出现报错,查看报错信息发现是当前用户没有权限删除某个文件夹导致的。于是在网上搜了很多资料,发现可用的是少之又少,于是自己写篇博客总结一下如何在OSX操作系统中修改jenkins的默认用户二、步骤①打开终端terminal②停止jenkins:launchctl unload /Library/
一、问题描述
二、步骤
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>StandardOutPath</key>
<string>/var/log/jenkins/jenkins.log</string>
<key>StandardErrorPath</key>
<string>/var/log/jenkins/jenkins.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>JENKINS_HOME</key>
<string>/Users/Shared/Jenkins/Home</string>
</dict>
<key>GroupName</key>
<string>wheel</string>#此处为用户所属的组,改为root用户所属的组
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.jenkins-ci</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Library/Application Support/Jenkins/jenkins-runner.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>#此处为jenkins默认用户,默认值为jenkins用户,改为root用户
<key>SessionCreate</key>
<true/>
</dict>
</plist>
chown -R root Jenkins/
chgrp -R wheel Jenkins/
⑤启动jenkins:launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
更多推荐
所有评论(0)