让詹金斯从Mercurial提交构建项目 [英] Let Jenkins build project from a Mercurial commit

查看:147
本文介绍了让詹金斯从Mercurial提交构建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在单个存储库中指定钩子?

Is there a way to specify a hook in the single repository?

现在,我们已经在"/etc/mercurial/hgrc"文件中指定了该钩子,但是每次它生成两次时,就会为每个存储库中的每次提交生成该钩子.

Now we have specified the hook in the "/etc/mercurial/hgrc" file, but every time it builds twice, and it builds for each commit in each repository.

所以我们要为每个存储库指定一个构建.

So we want to specify a build per repository.

这是我们实现钩子的方式:

This is how we implemented the hook:

[hooks]
changegroup = curl --silent http://jenkins:8080/job/ourProject/build

它在Ubuntu服务器上.

It's on a Ubuntu server.

推荐答案

  1. 构建触发器下选择轮询SCM 选项.
  2. 确保计划表为空.
  1. Select the Poll SCM option under Build Triggers.
  2. Make sure that schedule form is empty.

您应该在.hg目录中创建/home/user/mercurial/.hg/hgrc,并添加钩子为:

You should be creating in the .hg directory, /home/user/mercurial/.hg/hgrc and add hooks as:

[hooks]
commit.jenkins = wget -q http://localhost:8080/mercurial/notifyCommit?url=file:///home/user/mercurial > /dev/null
incoming.jenkins = wget -q http://localhost:8080/mercurial/notifyCommit?url=file:///home/user/mercurial > /dev/null

这篇关于让詹金斯从Mercurial提交构建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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