Skip to content

Instantly share code, notes, and snippets.

@actionless
Last active December 21, 2019 21:40
Show Gist options
  • Save actionless/cc270bb24316c4bda4a523e648e98010 to your computer and use it in GitHub Desktop.
Save actionless/cc270bb24316c4bda4a523e648e98010 to your computer and use it in GitHub Desktop.
buildbot scheduler with init build for new builder
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