GitLab push除发Jenkins事件

时间:2023-03-09 15:41:25
GitLab push除发Jenkins事件

1、打开Jenkins项目配置

2、勾选Trigger builds remotely (e.g., from scripts)

3、Authentication Token随便填个内容(比方123456),这样产生一个url:JENKINS_URL/job/project/build?token=TOKEN_NAME,例如 http://127.0.0.1:8080/job/mytest/build?token=123456

4、配置jenkins安全设置 Manager Jenkins->Configure Global Security->勾选Allow anonymous read access

5、取消勾选 Prevent Cross Site Request Forgery exploits

6、打开GitLab项目配置

7、Settings->Intergrations->URL填入http://127.0.0.1:8080/job/mytest/build?token=123456,下面有测试按钮,可以测试