[英]Gitlab CI, ssh runner
當我嘗試在部署控制台中創建ssh runner時出現此錯誤:
Running with gitlab-ci-multi-runner 1.7.1 (f896af7)
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
ERROR: Build failed (system failure): open ~/.ssh/id_rsa.pub: no such file or directory
在我的服務器上,我創建了ssh密鑰,這個密鑰位於〜/ .ssh / id_rsa.pub目錄中。 我的.gitlab-ci.yml文件:
stages:
- deploy
before_script:
- whoami
mate-finder:
stage: deploy
script:
- sudo apt-get update -qy
- sudo apt-get install -y nodejs
- sudo npm install
- sudo ng build
- sudo ng serve
如何在服務器上部署我的應用程序? 當我想在其上部署angular2應用程序時,如何在服務器上配置我的跑步者?
您需要檢查config.toml的位置。 你可以通過搜索來完成。
find / -name 'config.toml'
如果結果將是
/etc/gitlab-runner/config.toml
你以root
身份運行runner。 你需要指定像/root/.ssh/id_rsa
這樣的完整路徑。
如果不是 - 你在其他用戶下運行它,你需要指定目錄,如/home/user/.ssh/id_rsa
。
要找出你是哪個用戶 - 注冊shell
執行程序並運行pwd
或whoami
我相信如果不是root
那將是gitlab-runner
。
在我的例子中,我將~/.ssh/id_rsa
路徑更改為/root/id_rsa
。
當我在config.toml
更改它沒有幫助,但重新配置轉輪修復它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.