簡體   English   中英

通過NPM實現GitLab + GitLab CI +相關SSH項目

[英]GitLab + GitLab CI + Dependent SSH projects via NPM

目前我們正在使用GitLab管理我們的回購和GitLab CI作為我們的CI。

我有一個項目,其中包含另一個GitLab項目作為依賴項(通過NPM)。 該項目是內部的,package.json中的URL以git+ssh://git@開頭,這是我們在本地機器上使用的。 我們設置了SSH密鑰。

但是,GitLab CI似乎無法使用相同的機制來安裝此依賴項目(通過npm install )。

我得到的錯誤是:

npm install
npm ERR! git clone git@my.domain.com:developers/my-repo.git Cloning into bare repository '/home/gitlab_ci_runner/.npm/_git-remotes/git-my-domain-com-developers-my-git-26043eba'...
npm ERR! git clone git@my.domain.com:developers/my-repo.git
npm ERR! git clone git@my.domain.com:developers/my-repo.git Host key verification failed.
npm ERR! git clone git@my.domain.com:developers/my-repo.git fatal: The remote end hung up unexpectedly
npm ERR! Error: Command failed: Host key verification failed.
npm ERR! fatal: The remote end hung up unexpectedly
npm ERR! 
npm ERR!     at ChildProcess.exithandler (child_process.js:658:15)
npm ERR!     at ChildProcess.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:766:16)
npm ERR!     at Socket.<anonymous> (child_process.js:979:11)
npm ERR!     at Socket.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:466:12)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.2.0-68-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/gitlab_ci_runner/gitlab-ci-runner/tmp/builds/project-9
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! code 128
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/gitlab_ci_runner/gitlab-ci-runner/tmp/builds/project-9/npm-debug.log
npm ERR! not ok code 0

我們缺少什么? 我需要一個不需要我更改package.json的URL的解決方案。

您需要在CI服務器上的~/.ssh/known_hosts放置正確的主機( my.domain.com )密鑰。

通常只是移除從關鍵線路~/.ssh/known_hosts ,然后ssh荷蘭國際集團到它至少一次緩存的關鍵。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM