Gitlab+jenkins自动构建

  1. jenkins安装插件
    • Gitlab Hook Plugin
    • GitLab Plugin
  2. jenkins系统设置
    • Enable authentication for ‘/project’ end-point 去掉勾子,否则gitlab触发webhook自动构建,会出现调用jenkins没有权限的问题
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>Error 403 anonymous is missing the Job/Build permission</title>
    </head>
    <body><h2>HTTP ERROR 403</h2>
    <p>Problem accessing /project/robot_test. Reason:
    <pre>    anonymous is missing the Job/Build permission</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
    
    </body>
    </html>
    
  3. jenkins设置项目push自动编译
    • Build Triggers > Build when a change is pushed to GitLab
  4. Gitlab设置webhook
    • settings > Integrations,URL填jenkins项目里GitLab webhook URL后面的地址

发表评论

电子邮件地址不会被公开。