jenkins从gitlab拉取go项目且项目中引入私有仓库,go get报错connect: connection refused


问题:

使用jenkins从gitlab拉取go项目在编译时还需要下载import的私有库,报connect: connection refused

 

原因:

因gitlab没有开启https导致连接443端口失败

 

解决方法:

1. 在gitlab添加jenkins服务器的ssh公钥.

2.将http请求转换为ssh请求

git config --global url."git@gitlab.mycompany.com".insteadOf "https://gitlab.mycompany.com/"

3. 拉取代码

GOPROXY="" go get -insecure .

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM