How to use the buildbot.process.buildstep.BuildStepFailed function in buildbot

To help you get started, we’ve selected a few buildbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buildbot / buildbot / master / buildbot / steps / source / svn.py View on Github external
'commit')[0].attributes['revision'].value
            except (KeyError, IndexError):
                msg = ("SVN.parseGotRevision unable to detect Last Changed Rev in"
                       " output of svn info")
                log.msg(msg)
                # fall through and try to get 'Revision' instead

        if revision is None:
            try:
                revision = stdout_xml.getElementsByTagName(
                    'entry')[0].attributes['revision'].value
            except (KeyError, IndexError):
                msg = ("SVN.parseGotRevision unable to detect revision in"
                       " output of svn info")
                log.msg(msg)
                raise buildstep.BuildStepFailed()

        msg = "Got SVN revision %s" % (revision, )
        self.stdio_log.addHeader(msg)
        self.updateSourceProperty('got_revision', revision)

        return cmd.rc
github buildbot / buildbot / master / buildbot / steps / source / git.py View on Github external
def _fetchOrFallback(self, _=None):
        """
        Handles fallbacks for failure of fetch,
        wrapper for self._fetch
        """
        res = yield self._fetch(None)
        if res == RC_SUCCESS:
            defer.returnValue(res)
            return
        elif self.retryFetch:
            yield self._fetch(None)
        elif self.clobberOnFailure:
            yield self.clobber()
        else:
            raise buildstep.BuildStepFailed()
github buildbot / buildbot / master / buildbot / steps / source / git.py View on Github external
def evaluateCommand(cmd):
            if abandonOnFailure and cmd.didFail():
                log.msg("Source step failed while running command %s" % cmd)
                raise buildstep.BuildStepFailed()
            if collectStdout:
                return cmd.stdout
            else:
                return cmd.rc
        d.addCallback(lambda _: evaluateCommand(cmd))
github buildbot / buildbot / master / buildbot / steps / source / cvs.py View on Github external
def evaluate(cmd):
            if cmd.didFail():
                raise buildstep.BuildStepFailed()
            return cmd.rc
        return d
github buildbot / buildbot / master / buildbot / steps / source / svn.py View on Github external
def getUnversionedFiles(xmlStr, keep_on_purge):
        try:
            result_xml = xml.dom.minidom.parseString(xmlStr)
        except xml.parsers.expat.ExpatError:
            log.err("Corrupted xml, aborting step")
            raise buildstep.BuildStepFailed()

        for entry in result_xml.getElementsByTagName('entry'):
            (wc_status,) = entry.getElementsByTagName('wc-status')
            if wc_status.getAttribute('item') == 'external':
                continue
            if wc_status.getAttribute('item') == 'missing':
                continue
            filename = entry.getAttribute('path')
            if filename in keep_on_purge or filename == '':
                continue
            yield filename
github buildbot / buildbot_travis / buildbot_travis / steps / base.py View on Github external
"Please put a file named .travis.yml at the root of your repository:\n{0}".format(e))
            self.addHelpLog()
            raise

        self.addCompleteLog(filename, travis_yml)

        config = TravisYml()
        try:
            config.parse(travis_yml)
        except TravisYmlInvalid as e:
            self.descriptionDone = u"bad .travis.yml"
            self.addCompleteLog(
                "error",
                ".travis.yml is invalid:\n{0}".format(e))
            self.addHelpLog()
            raise buildstep.BuildStepFailed("Bad travis file")
        defer.returnValue(config)
github buildbot / buildbot / master / buildbot / steps / source / svn.py View on Github external
def checkInstall(svnInstalled):
            if not svnInstalled:
                raise buildstep.BuildStepFailed(
                    "SVN is not installed on worker")
            return 0
github buildbot / buildbot / master / buildbot / steps / source / repo.py View on Github external
def evaluateCommand(_):
            if abandonOnFailure and cmd.didFail():
                self.descriptionDone = "repo failed at: %s" % (
                    " ".join(command[:2]))
                self.stdio_log.addStderr(
                    "Source step failed while running command %s\n" % cmd)
                raise buildstep.BuildStepFailed()
            return cmd.rc
        return d
github buildbot / buildbot / master / buildbot / steps / source / mtn.py View on Github external
yield self._dovccmd(['mtn', 'db', 'migrate', '--db',
                                     self.database],
                                    workdir='.')
            elif stdout.find("too new, cannot use") >= 0 or \
                    stdout.find("database has no tables") >= 0:
                # The database is of a newer format which the worker's
                # mtn version can not handle. Drop it and pull again
                # with that monotone version installed on the
                # worker. Do the same if it's an empty file.
                yield self.runRmdir(self.database)
                db_needs_init = True
            elif stdout.find("not a monotone database") >= 0:
                # There exists a database file, but it's not a valid
                # monotone database. Do not delete it, but fail with
                # an error.
                raise buildstep.BuildStepFailed()
            else:
                log.msg("Database exists and compatible")
        else:
            db_needs_init = True
            log.msg("Database does not exist")

        if db_needs_init:
            command = ['mtn', 'db', 'init', '--db', self.database]
            yield self._dovccmd(command, workdir='.')