Gitlab-ci - 管道无法运行

Jos*_*des 4 ubuntu amazon-ec2 gitlab gitlab-ci gitlab-ci-runner

当我尝试运行管道时出现以下错误

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

这与 gitlab-runner 权限有关吗?我已尝试授予其完全访问权限,但仍然失败。有人可以帮我吗?

我正在遵循 gitlab 上提到的指南 https://docs.gitlab.com/runner/install/linux-manually.html

Gitlab Runner 版本:13.4.1 Git 修订版:e95f89a0 Git 分支:13-4-stable GO 版本:go1.13.8 内置:2020-09-25T20:03:43+0000 OS/Arch:linux/amd64

Ubuntu 发行商 ID:Ubuntu 描述:Ubuntu 20.04.1 LTS 版本:20.04 代号:focal

Jos*_*des 6

我似乎找到了解决方法。

正如@maksim.danilinhttps://gitlab.com/gitlab-org/gitlab-runner/-/issues/2126上的回答

  • .*从 /home/gitlab-runner 中的文件中删除所有文件
  • rm *如果您位于 gitlab-runner 文件夹中,应该可以解决问题

进一步遵循@Reactgular的解决方案(How to use sudo in build script for gitlab ci?

  • 授予用户 sudogitlab-runner权限
    • $ sudo usermod -a -G sudo gitlab-runner
  • 删除 gitlab-runner 用户的 sudo 密码限制
    • $ sudo visudo
  • 将以下内容添加到文件底部
    • gitlab-runner ALL=(ALL) NOPASSWD: ALL