|
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Copyright Buildbot Team Members
"""Trigger this scheduler with the given sourcestampset ID. Returns a deferred that will fire when the buildset is finished.""" # properties for this buildset are composed of our own properties, # potentially overridden by anything from the triggering build
# note that this does not use the buildset subscriptions mechanism, as # the duration of interest to the caller is bounded by the lifetime of # this process. properties=props) else: d = self.addBuildsetForLatest(reason=self.reason, properties=props)
# cancel any outstanding subscription if self._bsc_subscription: self._bsc_subscription.unsubscribe() self._bsc_subscription = None
# and errback any outstanding deferreds if self._waiters: msg = 'Triggerable scheduler stopped before build was complete' for d, brids in self._waiters.values(): d.errback(failure.Failure(RuntimeError(msg))) self._waiters = {}
return base.BaseScheduler.stopService(self)
self.master.subscribeToBuildsetCompletions( self._buildsetComplete)
# pop this bsid from the waiters list, and potentially unsubscribe # from completion notifications
# fire the callback to indicate that the triggered build is complete |