OS X 安装时未创建“Jenkins”用户

bra*_*ray 4 macos xcode jenkins

在阅读有关 Jenkins 安装的内容时,许多指南都谈到安装程序在 OS X 上创建了一个名为“Jenkins”的用户。该用户似乎对于某些任务很重要。但是,使用 homebrew 安装 Jenkins 2.32 不会在此处安装此用户。这是为什么——我错过了什么吗?

背景:我想与 Gitlab 服务器一起运行 iOS 版 CI。

etu*_*usm 5

通过 Homebrew 安装的 Jenkins 有点混乱——我这么说是因为日志输出中不太明显哪里/谁获得了权限。

Jenkins 不会在 Mac OS 上创建 jenkins 用户(在我看来,也不应该)。

默认情况下,主动使用的用户brew install jenkins将获得默认权限。该用户主文件夹中应该有一个/.jenkins文件夹(例如/Users/<your_user>/.jenkins:)

问题是,当brew完成运行时,一些应该符号链接到活动用户的文件却没有- 因此您可能会使用 rvm/ruby 创建作业,并收到捆绑程序无法写入系统 ruby​​ 的错误。

在终端/iTerm 中尝试一下:

sudo chown whoami/Library/LaunchDaemons/homebrew.mxcl.jenkins.plist

whoami应该被蜱虫包围`

我倾向于在之后执行这些命令brew install jenkins

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

将 Jenkins plist 文件符号链接到 /Library/LaunchAgents

sudo cp -fv /usr/local/opt/jenkins/*.plist /Library/LaunchDaemons

将 plist 文件复制到 /Library/LaunchDaemons

sudo chown我是谁/Library/LaunchDaemons/homebrew.mxcl.jenkins.plist

将列出的 plist 文件的 sudo 所有权完全授予用户


这部分没必要...

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

这里有一个东西可以参考:

http://flummox-engineering.blogspot.com/2016/01/installing-jenkins-os-x-homebrew.html