[Buildbot-commits] [Buildbot] #2164: Triggering a Nightly Build only if Continuous build status is success

Buildbot nobody at buildbot.net
Fri Dec 16 23:33:58 UTC 2011


#2164: Triggering a Nightly Build only if  Continuous build status is success
----------------------------+------------------
Reporter:  mariamarcano     |       Owner:
    Type:  support-request  |      Status:  new
Priority:  major            |   Milestone:
 Version:  0.8.3p1          |  Resolution:
Keywords:                   |
----------------------------+------------------

Comment (by mariamarcano):

 Replying to [comment:1 dustin]:
 > That will require a custom scheduler -- you could probably subclass the
 Nightly scheduler?

 Dustin

 I came up with the following, which seems to work fine, it requires adding
 it to master.cfg I am not an expert on Buildbot or the code so I will
 appreciate your feedback


 {{{

 class DependentNightly(Nightly):

     relatedBuilderNames = []

     def __init__(self, relatedBuilderNames = [], **kwargs):
         Nightly.__init__(self, **kwargs)
         self.relatedBuilderNames = relatedBuilderNames

     def startBuild(self):
         startBuild = True
         for builderName in  self.relatedBuilderNames:
             builder_status = self.master.status.getBuilder(builderName)
             lastBuild = builder_status.getLastFinishedBuild()
             startBuild = startBuild & (lastBuild.getResults() != FAILURE)

         if (startBuild):
             return Nightly.startBuild(self)
         else:
             log.msg(("Nightly Scheduler <%s>: skipping build " +
                          "- Check related builders that could be failing:
 <%s> ") % (self.name, ", ".join(self.relatedBuilderNames)))
             return defer.succeed(None)


 c['schedulers'] = []

 c['schedulers'].append(DependentNightly(name="full-daily",
                                branch='branches/Maria/AutomatedTest-
 xUNIT',
                                onlyIfChanged=False,
                                relatedBuilderNames=["continuous-debug",
 "continuous-release"],
                                hour=[15], minute=17,
                                builderNames=["full-dbupgrade"]
                              ))

 }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2164#comment:2>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list