When I try to create ssh runner in deploy console I have this error:
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
On my server I created ssh key, and this key is in directory ~/.ssh/id_rsa.pub. My .gitlab-ci.yml file:
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
How can I deploy my application on server? How must I configure my runner on the server, when I want to deploy my angular2 application on it?
You need to check, where config.toml is placed. You can do it with a search.
find / -name 'config.toml'
If result would be
/etc/gitlab-runner/config.toml
You running runner as root
. And you need to specify full path like /root/.ssh/id_rsa
.
If no - you running it under other user and you'll need to specify directory like /home/user/.ssh/id_rsa
.
To find out which user you are - register shell
executor and run pwd
or whoami
I believe it would be gitlab-runner
if not root
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With