zoukankan      html  css  js  c++  java
  • 创建Jenkins构建触发器,代码提交至gitLab即自动触发构建

    下载所需插件,系统设置--》插件管理,搜索以下两个插件,选择安装

    img

    登录gitLab,生成一个Personal Access Tokens

    img

    img

    img

    进入Jenkins,添加api token,路径:首页--》凭据--》添加凭据

    img

    添加后再次打开,如图所示

    img

    然后打开系统管理,进入系统设置,配置gitLab

    img

    然后进入job,进行配置

    img

    img

    进入GitLab,打开项目--》settings

    img

    img

    img

    测试成功,返回200

    img

    到此,触发器配置成功,开发一旦有提交代码,就会自动构建,如图所示

    img

    Ps:遇到的问题: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 ,保存更改即可解决问题

    img

  • 相关阅读:
    PTA 7-6 列出连通集(深搜+广搜)
    TZOJ 2648 小希的迷宫(并查集)
    HDU 3342 Legal or Not(拓扑排序)
    哈夫曼树
    mst
    [THUWC2017]随机二分图
    视察
    [bzoj3274]Circle
    [bzoj3273]liars
    求导相关
  • 原文地址:https://www.cnblogs.com/liyao0312/p/14893766.html
Copyright © 2011-2022 走看看