lerna publish on Jenkins “git remote update” Fails “Could not read from remote repository.”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 20:40:50

I ssh'd into the jenkins box and cd into the workspace.

I ran git remote update and it stdout this:

Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.

It seems I didn't have github's IP added.

You need to make sure with which account Jenkins is running on the Jenkins box:

If you do have the right ~/.ssh/id_rsa(.pub) private/public key, Jenkins must run with that user for ~ to reflect the right HOME.

If you can connect to the Jenkins machine, you can then test your ssh connection with:

cd /apth/to/repo
git remote -v
  # should return an ssh URL
  # like:
  # git@aserver.com
ssh -T git@aserver.com

The OP ThomasReggi confirms the account issue in the comments with:

I have been SSH'd into the machine via root and can view access.
I am pulling the repo down with a user and have a key in Jenkins using the Git plugin, but now lerna is running outside that plugin and needs ssh access to the repo and it's not available at the user level.

All I needed to do was add the SSH Agent plugin and in my job's configure use the same SSH credentials I used to setup the GitHub plugin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!