我如何 运行 Buildbot 以非 root 身份在 worker/slave 上构建步骤

How can I run Buildbot build steps on worker/slave as non-root

当我 运行 以 root 身份通过 electron-packager 构建 electron 时遇到问题。但是,当我 运行 作为其他用户时,它工作得很好,比如 vagrant。

我已经问过关于这个问题的问题here.

但是,我认为如果我可以将 Buildbot 配置为 运行 作为 worker/slave 上的非根用户,我就可以解决这个问题。

我找不到任何资源来解释这种配置设置。

我 运行宁 Buildbot Master 和 Worker(Slave)是一个单独的 Vagrant CentOS7 VM。一切正常,但调用 npm run-script build-linux 的构建步骤失败,如链接问题中所述。

环境信息

Mac OS X 10.11.5
Vagrant version: 1.8.4
Linux CentOS 7 3.10.0-327.18.2.el7.x86_64
Python version: 2.7.5
Buildbot version: 0.8.14
Buildslave version: 0.8.14
Twisted version: 16.3.2

Buildbot-slave 运行宁作为 root 因为我在配置脚本中使用了 sudo,即

sudo pip install buildbot-slave

修复只是使用:

pip install buildbot-slave

运行 twistd --nodaemon --no_save -y buildbot.tac & 通过 supervisord。 在 buildbot.conf 文件中设置 user=vagrant。需要 vagrant ssh 进入 vm 到 运行 supervisord -n &,因为 运行 在 vagrant up 期间通过 provision.sh 仍然 运行s buildslave 作为 root。

感谢@Louis 的评论为我指明了正确的方向。