User:Bhearsum/Buildbot/Custom Steps

These are used to clobber a tree every 10 builds. (TODO: Make it possible to clobber every Nth builds):

class MozillaMaybeClobber(ShellCommand):
    name = "maybe clobber"
    warnOnFailure = True
    description = ["clobbering"]
    descriptionDone = ["did not clobber"]
    command = ["true"]
    workdir = "."

    def start(self):
        buildNum = self.step_status.getBuild().getNumber()
        if (buildNum % 10) == 0:
            self.command = ["rm", "-rf", "mozilla"]
            self.descriptionDone = ["clobbered"]
        ShellCommand.start(self)


class MozillaMaybeClobberWin32(ShellCommand):
    name = "maybe clobber"
    warnOnFailure = True
    description = ["clobbering"]
    descriptionDone = ["did not clobber"]
    command = ["true"]
    workdir = "."

    def start(self):
        buildNum = self.step_status.getBuild().getNumber()
        if (buildNum % 10) == 0:
            self.command = ["rmdir", "/s", "/q", "mozilla"]
            self.descriptionDone = ["clobbered"]
        ShellCommand.start(self)