Can Hudson be configured to build every revision?

前端 未结 5 1519
终归单人心
终归单人心 2021-02-06 07:45

I\'ve started experimenting with Hudson as a build server. I\'m using subversion and have it configured to poll every minute. The issue I\'m seeing is that if a build at revisio

5条回答
  •  温柔的废话
    2021-02-06 08:28

    I took fchateaus approach above (thanks man!) and modified it to work with Mercurial.

    You will need to edit .hg/hgrc on the central server, and put in a changegroup hook. Keep in mind that changegroups only set the first changeset to the HG_NODE environment variable, so you have to do a hg tip to grab the real tip node and pass that along via URL instead. A bit of a trick to do in a one-liner, but I figured it out.

    This is what you would do for Hudson running on Windows.

    [hooks]
    # this uses wget to hit the hudson url responsible for starting a build - %HG_NODE% only gets first changeset of changegroup, so use hg tip to grab changeset most recently added instead
    changegroup.hudson = for /f "tokens=*" %G IN ('hg tip --template {node}') DO "C:\Program Files (x86)\UnxUtils\usr\local\wbin\wget" --non-verbose --spider http://HudsonServer:8080/job/{Repository}/buildWithParameters?HgRevId=%G | ECHO Result of Hudson Polling Request For Node %G
    # TODO: when Hudson implements polling with parameters, change to something like this
    #changegroup.hudson = for /f "tokens=*" %G IN ('hg tip --template {node}') DO "C:\Program Files (x86)\UnxUtils\usr\local\wbin\wget" --non-verbose --spider http://HudsonServer:8080/job/{Repository}/polling?HgRevId=%G | ECHO Result of Hudson Polling Request For Node %G
    

提交回复
热议问题