当git提交完成时运行Jenkins [英] Run Jenkins build when git commit is done

查看:146
本文介绍了当git提交完成时运行Jenkins的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题是发布在不同的topic.But我的情况有点不同。



我想触发我的测试目标时提交检测到由詹金斯。在互联网上的大多数教程都展示了如何使用WebHook来完成这项工作。



在我的例子中,我遇到了两个问题:

1)我没有找到选项检测到提交时触发器构建



$ 2)所有教程都讲述了如何从Git URL配置webhook。在我的情况下,我的git存储库是本地的,我没有访问web界面的权限。所以如何手动做同样的事情?



预先感谢您

配置:


  • Jenkins Server 1.651.1

  • Git Plugin 2.4.4,


解决方案

您以一种不同的方式做到这一点:$ b​​
$ b

您使用web-hook来捕获新的git提交时间,并在钩子中使用其他API启动Jenkins作业。



https://wiki.jenkins-ci.org/display/JENKINS/Remote+access + API



阅读所有关于它的信息:



http://kohsuke.org/2011/12 / 01 / polling-must-die-triggering-jenkins-build-from-a-git-hook /


I know that this question is posted in different topic.But my case is a little bit different.

I want to trigger my test goal when a commit is detected by Jenkins. Most tutorials in the internet show how to do this using WebHook.

In my case I have two problems :

1) I did not find the option "Trigger build when a commit is detected"

2) All tutorials speak about configuring webhook, from Git URL.in my case, my git repository is local and I did not have access to the web interface. So how to do the same thing manually ?

Thank ou in advance

Configuration :

  • Jenkins Server 1.651.1
  • Git Plugin 2.4.4,

解决方案

You do it in a little bit different way:

You do use a web-hook to capture when new git commit was made and in the hook you start the Jenkins job with the rest API.

https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Read all about it in here:

http://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/

这篇关于当git提交完成时运行Jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆