Gitlab CI - 以 root 身份运行 gitlab-runner

alp*_*pio 7 gitlab gitlab-ci gitlab-ci-runner

我是 iOS 上持续集成的新手,我尝试使用 gitlab-runner 运行构建并使用 shell 作为执行程序,但我遇到了问题,pod cannot run as root我确定我没有使用 sudo 安装 cocoapods,我尝试运行whoamibefore_script这是正确的我的运行程序运行根 在此处输入图片说明

有人遇到同样的问题吗?如何解决?

Rek*_*vni 5

在没有 sudo 的情况下注册运行器,这应该将运行器设置gitlab-runner为以当前用户身份运行。

所以步骤应该是:

sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64

sudo chmod +x /usr/local/bin/gitlab-runner

gitlab-runner register ...

gitlab-runner install
Run Code Online (Sandbox Code Playgroud)

请记住停止您的 sudogitlab-runner服务,否则您可能会在同一台机器上有多个运行者争夺相同的工作。