1、安装Gitlab插件

2、Jenkins进行相关配置
安装完后,进入项目的配置页面,出现红框中的选项。

勾选该选项,并按需完成以下配置。




3、Gitlab进行相关配置
进入项目仓库-Settings-Integrations,进行Webhooks配置。

如遇到以下问题:gitLab上添加webhook保存,报错Requests to localhost are not allowed
解决方案:使用管理员帐号登录,进入Admin area,在Admin area中,在settings标签下面,找到OutBound Request,勾选上Allow requests to the local network from hooks and services ,保存更改即可。

网友评论