开发者

Using Hudson Continuous Integration, can I track build status separately for each branch without manually adding jobs for each branch?

开发者 https://www.devze.com 2023-01-23 04:34 出处:网络
We\'re using git for version control and the workflow is such that people do their work in a branch.In order to benefit from CI in that bra开发者_JS百科nch we want Hudson to build it and test it.Howev

We're using git for version control and the workflow is such that people do their work in a branch. In order to benefit from CI in that bra开发者_JS百科nch we want Hudson to build it and test it. However, just because the branch is broken doesn't mean the whole build is broken.

Thus, I'm wondering if I could tell Hudson to report build status separately for every branch rather than a single build status.

I'm aware that I can create a new job for each branch manually but its cumbersome and error-prone. I'd like something more automatic.

I'm wondering if there's a plugin, setting, or script for Hudson that would do this for me.

OR if there is a decent alternative to Hudson that would do so.


How to best divide jobs depends on how you're using branches. In our svn-based system, we have branches for each product release, so it's natural to have a separate job for each branch. I can understand the issue if you have lots of feature branches. There are some tips on the git plugin page for managing a stable integration branch.

Can you describe more specifically what's cumbersome and error-prone? Perhaps there are plugins or Hudson tips that can make it easier.

Here are a couple tips for job creation:

  • You can set up a template job from which new branch jobs can be copied to make creation easier.
  • Your template job can use a build parameter to specify the branch. That makes it easier to modify a value in one place and use it in several (e.g. in the checkout and passed into the build).
  • If branch creation is frequent, you can automate the corresponding job creation through the Hudson Remote API (see also http://your-hudson-server/api)

Update: this git post-receive hook script (found by @Dobes) provides an automated way to create a job in Hudson when a branch is created in git.

0

精彩评论

暂无评论...
验证码 换一张
取 消