持续集成jenkins+github

  1. 配置Github
    a. 登陆github账户,进入settings-->Developer settings-->Personal access tokens--> Generate new token
    输入token description 选中repo和admin:repo_hook
    点击Generate token,保存生成的token。


    持续集成jenkins+github_第1张图片
    6D21ED79-808B-4831-960E-A4ACAAE44D29.png

    C1F5AC0E-9686-445E-90E8-355712819B3D.png

    持续集成jenkins+github_第2张图片
    7A11428D-13E3-4B68-94E3-F7C443372AD5.png

    b. 登陆Jenkins
    Manage Jenkins--> Configure System--> Github-->Add GitHub Server
    输入name 点击add
    Kind选择Secret text
    其中Secret为github中上一步生成的token
    选择 Credentials,点击Test coonnection,显示Credentials verified for user xxx, rate limit: xxxx,说明配置完成了




    持续集成jenkins+github_第5张图片
    A12BD3BA-85A4-4ACD-A57B-7426BF84FE8B.png


    c. 配置Jenkins在Hook URL中监听Github的Post请求,然后进行自动构建,所以接下来配置Hook URL,点击Advance ,勾选 Override Hook URL

    d.Github项目配置webhook
    进入一个项目中,settings-->webhooks-->add webhook

    填好信息,add webhook



  2. 部署项目



  1. 提交代码到Github,进行测试。

你可能感兴趣的:(持续集成jenkins+github)