Hudson 作业可以在不下拉代码的情况下轮询 SCM 吗?
我有一个工作,我想在每次提交到存储库时运行。我想避免拉下这段代码,我只想要通知构建触发器。那么,是否有一种方法可以在构建时不拉取 SCM 中的某些存储库,或者可以轮询 SCM 中没有的内容以进行构建?
I have a job that I want to run every time a commit is made to a repository. I want to avoid pulling this code down, I only want the notification build trigger. So, is there either a way to not pull down certain repositories in your SCM upon a build or a way to poll things that aren't in the SCM for a build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 提交后挂钩 来触发您的哈德森的工作。
you could use a post commit hook to trigger your hudson job.
由于您想避免更改 SVN,因此您必须编写一个每隔一段时间执行一次的作业(可能每 5 分钟一次)。此作业使用 Windows bach 或 shell 脚本任务运行 svn 命令来获取相关分支的当前修订版本。如果有变化,您可以将作业状态设置为不稳定。不要使用失败,因为您无法区分真正的失败和存储库更改。我认为有一个插件可以根据您输出的内容设置作业状态。
然后,您可以使用电子邮件扩展插件在每次修订更改时发送电子邮件。您可以从上次(或者更好的是上次成功或不稳定)作业中获取修订号。您可以存档包含作业修订号的文件,也可以使用描述设置器插件将作业的描述设置为修订版。查看 Hudsons 远程 API,了解如何从之前的工作中获取信息。
因为你白天经常做你的工作。不要忘记删除旧的作业运行。但我会保留至少两天的历史记录,以防你的 svn 宕机 24 小时。
Since you want to avoid changing SVN, you have to write a job that gets executed every so often (may be every 5 Minutes). This jobs runs a svn command using windows bach or shell script task to get the current revision for the branch in question. You can set the status of the job to unstable if there is a change. Don't use failure because you can't distinguish than between a real failure and a repository change. I think there is a plugin that sets the job status depending on the contents of you output.
You can then use the email extension plugin to send an email every time the revision changes. You can get the revision number from the last (or better the last successful or unstable) job. You can archive a file containing the revision number on the jobs or you can set the description for the job to the revision using the description setter plugin. Have a look at Hudsons remote API for ideas on how to get the information from the previous job.
Since you run your job very often during the day. don't forget to delete old job runs. But I would keep at least two days worth of history, just in case your svn is down for 24 hours.