[users at bb.net] build properties from previous build

Thomas Roos thomas at roosesweb.de
Tue Jan 26 16:31:14 UTC 2016


Thank you for the example Pierre - what I finally did is ugly, but it
works, any tips for making it nice are welcome:

def getLastBuild(builderStatus, currbuildid=-2):
        last_build = builderStatus.getBuild(currbuildid)
        if last_build is None:
            return
        else:
            return last_build

from buildbot.process import properties
@properties.renderer
def getBranchFromLatestBuild(props):
    status = props.getBuild().master.status
    builder = status.getBuilder("xxx_name_factory")
    b = getLastBuild(builder)
    return "echo " + b.getProperty("branch")


xxx_factory.addStep(shell.SetProperty(command=getBranchFromLatestBuild,
property="recent_branchurl"))

2016-01-25 9:12 GMT+01:00 Pierre Tardy <tardyp at gmail.com>:
> Hi there I'd no official api todo this despite indeed this could be pretty
> useful.
> Having said that depending on the buildbot version you are targeting I can
> help you. It won't be the same way in eight or nine
>
>
> Le lun. 25 janv. 2016 07:43, Thomas Roos <thomas at roosesweb.de> a écrit :
>>
>> Hi,
>> is there a way to get build properties from previous build?
>> What I wanna do is a clean build if the user changed the branch
>> variable, but do treestable builds if the branch is unchanged.
>> Any ideas?
>> cheers, Thomas
>> _______________________________________________
>> users mailing list
>> users at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/users


More information about the users mailing list