尝试使用 gitlab 和远程服务器设置 CI

Trying to setup CI with gitlab and a remote server

推送到 gitlab repo 正在工作 fine.Now web hook 添加到推送时的 gitlab 以调用远程中的文件 server.The PHP 该文件中的代码是 git pull.

当我git从终端拉出时它工作fine.But当我点击那个URL时显示错误

"sudo: 不存在 tty 且未指定 askpass 程序"

当主分支被推送到 gitlab 仓库后,当钩子命中 link 时也会出现此错误。

错误消息试图提示您输入密码但不能,因为没有终端。

为防止这种情况发生,您需要编辑 sudoers 文件。在您的机器上键入 sudo visudo 并添加以下行:

username ALL = NOPASSWD: /bin/git

这将允许 username 在没有任何密码的情况下使用 git。

在默认的 apache 安装中,用户名可以是 www-dataapache,但您需要自己检查一下。