我在自己的ubuntu服务器上有一个简单的gitlab-runner设置。它是通过以下方式注册的:
sudo gitlab-runner register -n --url https://gitlab.com/ --registration-token {{GITLAB_REGISTRATION_TOKEN}} --executor shell --description "{{GITLAB_RUNNER_DESCRIPTION}}"
唯一正在运行的gitlab-runner进程(ps -ef
)是:
/usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner
我的/etc/gitlab-runner/config.toml
配置文件包含:
concurrent = 1
check_interval = 0
[[runners]]
name = "iouze/landing"
url = "https://gitlab.com/"
token = "0530b.....6f9"
executor = "shell"
[runners.cache]
当我的CI管道触发时,作业有时会以用户gitlab-runner用户的身份被选中,在这种情况下,它们会正确地运行(作为sheell执行器)。
但有时,它以root身份运行,在这种情况下,它作为docker执行器运行,然后显示错误(因为脚本运行在意外的环境中)。
为什么它有时会以root用户的身份运行,而服务上显然有--用户?
https://stackoverflow.com/questions/47682531
复制相似问题