对于Jenkins和gitlab连接的注意事项

前提

Linux服务器上,已安装好Jenkins和gitlab,安装步骤见
https://blog.csdn.net/weixin_39648534/article/details/115839531

注意点1

在Jenkins上面构建Git源码时,
在这里插入图片描述
特别是通过域名访问gitlab时,注意即使Jenkins和gitlab装在同一台服务器上,也要开放22端口给Jenkins,即将Jenkins所在服务器的公网IP加入 22端口安全组中(该端口权限全放开的就当我啥也没说),不然会连接不上,报如下错误:

Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@xx.xx.xx:root/store-pc.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: ssh: connect to host xx.xx.xx port 22: Connection timed out
fatal: Could not read from remote repository.

远程ssh访问gitlab服务器时,默认访问登录端口22

注: 并不需要额外配置~/.ssh/config 文件

以下两个ssh远程访问测试命令,好用收藏

ssh -T git@xx.xx.xx
ssh -vT git@xx.xx.xx
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值