Last active
December 21, 2019 21:40
-
-
Save actionless/cc270bb24316c4bda4a523e648e98010 to your computer and use it in GitHub Desktop.
buildbot scheduler with init build for new builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InitialBuild(schedulers.Periodic): | |
@defer.inlineCallbacks | |
def startBuild(self): | |
if not self.enabled: | |
return | |
log.msg(str(self.builderNames)) | |
builder_name = self.builderNames[0] | |
builder_id = yield self.master.db.builders.findBuilderId(builder_name) | |
recent_builds = yield self.master.db.builds._getRecentBuilds( | |
(self.master.db.model.builds.c.builderid == builder_id) | |
) | |
log.msg(str(recent_builds)) | |
if not recent_builds: | |
super().startBuild() | |
self.enabled = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment