我想要实现的目标

gitlab运行程序与gitlab在同一服务器上运行,gitlab也运行在应用程序运行的同一项目上(预算) .

当master更新时,我只想在本地部署应用程序,它是一个PHP应用程序,它是用户作曲家 . 所以一个重要的事实是我不能有不同的git url . 它必须是git@gitlab.xxx.xxx:project / repo.git无处不在 .

问题

在本地克隆时,我似乎无法访问回购 .

Cloning into 'test'...
The authenticity of host 'gitlab.xxx.xxx (xxx.xxx.xxx.xxx)' can't be established.
ECDSA key fingerprint is qw:qw:qw:qw:qw:qw:qw:qw:qw.
Are you sure you want to continue connecting (yes/no)? 
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

我的开发机器中的克隆工作正常,我的密钥被添加到gitlab中对项目有权限的用户:

git clone 'git@gitlab.xxx.xxx:project/repo.git'

我试过的

  • 执行克隆的用户是gitlab runner,我确实生成了一个ssh密钥并将其添加到项目中 .

  • 试图检查密钥是否实际上由代理 ssh-add -l 使用,但似乎我的知识太有限,因为这导致: Could not open a connection to your authentication agent. 也许是因为我使用 su gitlab-runner

  • ......死在水中,我觉得它与ssh的工作方式有关,以及它在同一台服务器上运行时的原因 . 就像我说的,即时通讯使用依赖管理器不允许env变量用于特定包的repo之类的东西,所以我坚持在服务器和我的开发机器上使用 git@gitlab... url .