我想将文件从Jenkins发送到我在Google Compute引擎实例中的实例,我在jenkins的配置中添加了一个版本:
rsync -vrzhe "ssh -i /var/lib/jenkins/.ssh/google_compute_engine -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no" . login@Host:/var/www
我得到这个错误:
Checking out Revision 59cf9dd819fe2168c4c40f716707d58b2b99e251 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 59cf9dd819fe2168c4c40f716707d58b2b99e251
> git rev-list 59cf9dd819fe2168c4c40f716707d58b2b99e251 # timeout=10
[Platform] $ /bin/sh -xe /tmp/hudson4502433356962914860.sh
+ rsync -vrzhe 'ssh -i /var/lib/jenkins/.ssh -o UserKnownHostsFile=/dev/null -o
CheckHostIP=no -o StrictHostKeyChecking=no' . login@Host:/var/www
StrictHostKeyChecking=no' . login@host:/var/www
ssh: connect to host host port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
Build step 'Exécuter un script shell' marked build as failure
Finished: FAILURE
任何的想法
问题出在我的公钥上,因此要解决此问题,您需要:
1-设置ssh密钥:运行
gcloud compute ssh example-instance
2-将.ssh / google_compute_engine.pub内容cp到GCE VM的authorized_key中
3-重新启动VM实例
谢谢你的帮助
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句