[Buildbot-devel] Perforce (P4) commit trigger

Tony Walker tony.walker at crocodile-clips.com
Wed Sep 6 13:28:49 UTC 2006


Hi,

Thanks for getting back to me so soon. I have now solved this. I am 
currently running version 0.7.1 of buildbot and the p4poller.py in the 
newest release of buildbot (0.7.4?) seems to have taken care of this 
issue, there is added branch functionality. I just ported this code over 
to my existing build and it now works perfectly, the perforce branch 
gets monitored/polled and a build gets triggered on submission, happy days!

Thanks very much for the help.

Tony.

Ben Hearsum wrote:
> I actually haven't worked with Perforce before but my guess is that the
> branch option for the Scheduler needs to be the same as name of the
> branch in the Perforce repository.
>
> Tony Walker wrote:
>   
>> Hi,
>>
>> Thanks for the information. Ok, so I have set up a p4poller in the
>> master config file like this:
>>
>> p4_source = p4poller.P4Source(p4port="192.168.0.80:1666",
>> p4user="general",p4client="buildmaster",
>> p4base="//depot/Dev/Projects/Sublines/stage_a/...",
>> p4bin="/usr/local/bin/p4",pollinterval=300)
>>
>> and a scheduler to suit:
>>
>> c['schedulers'].append(Scheduler(name="all", branch="stage_a",
>> treeStableTimer=2*60, builderNames=["builder_a","builder_b"]))
>>
>>
>> What I have noticed from the log on the buildmaster side is that it now
>> seems to be polling the perforce repository, which is great, and it gets
>> a submitted change. However, it doesn't seem to kick off a build 'two
>> minutes' later. I noticed that in the 'scheduler.py' file, two branches
>> are getting compared, change.branch and self.branch. Now,
>> self.branch=stage_a (which is correct), but change.branch=None  ?? So it
>> won't build. So my question is, where is this supposed to be set? I can
>> assume at this point that p4poller.py is extracting information and
>> setting these variables up, but missing the branch, is this correct? Any
>> ideas would be greatly appreciated.
>>
>> Thanks,
>>
>> Tony.
>>
>> Ben Hearsum wrote:
>>     
>>> I haven't used the P4 modules before, but I believe you would use the
>>> P4Source module along with a Scheduler. The P4Source would submit
>>> changes to the BuildMaster and the Scheduler can be configured to build
>>> after the tree is quiet for X minutes.
>>>
>>> Documentation can be found here:
>>> http://buildbot.sourceforge.net/manual-0.7.4.html#P4Source
>>> http://buildbot.sourceforge.net/manual-0.7.4.html#Scheduler-Types
>>> http://buildbot.sourceforge.net/API-0.7.4/buildbot.scheduler.Scheduler-class.html
>>>
>>>
>>> Tony Walker wrote:
>>>  
>>>       
>>>> Hi,
>>>>
>>>> I have a buildmaster with several buildslaves. Our Perforce
>>>> repository resides on a separate machine on our network. What I would
>>>> like to know is how do I trigger a build on one of the slaves after a
>>>> piece of code has been checked in to perforce on a particular branch.
>>>> Has anyone done this before? We use triggers quite a lot in perforce,
>>>> for example, we have a script that emails changes to staff. So, how
>>>> do I issue a command to the buildmaster (that resides on a different
>>>> machine) to start a build after there has been a commit?
>>>>
>>>> Thanks,
>>>>
>>>> Tony.
>>>>
>>>>     
>>>>         

-- 
Tony Walker

-------------------------
Crocodile Clips
www.crocodile-clips.com

t: (0131) 226 1511
f: (0131) 226 1522
-------------------------

This communication is confidential and for use by the intended
recipient only. If the message is received by anyone other than the
intended recipient, please return to the sender by replying to it and
take no further action.  Thank you.

The contents of this email may contain personal views which are not
the views of Crocodile Clips Ltd, unless specifically stated.







More information about the devel mailing list