31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
from buildbot.steps.shell import ShellCommand
|
|
from buildbot.status.builder import FAILURE, SUCCESS
|
|
|
|
class GetBuildID(ShellCommand):
|
|
"""Retrieves the BuildID from a Mozilla tree (using platform.ini) and sets
|
|
it as a build property ('buildid'). If defined, uses objdir as it's base.
|
|
"""
|
|
description=['getting buildid']
|
|
descriptionDone=['get buildid']
|
|
haltOnFailure=True
|
|
|
|
def __init__(self, objdir="", **kwargs):
|
|
ShellCommand.__init__(self, **kwargs)
|
|
self.addFactoryArguments(objdir=objdir)
|
|
|
|
self.objdir = objdir
|
|
self.command = ['python', 'config/printconfigsetting.py',
|
|
'%s/dist/bin/application.ini' % self.objdir,
|
|
'App', 'BuildID']
|
|
|
|
def commandComplete(self, cmd):
|
|
buildid = ""
|
|
try:
|
|
buildid = cmd.logs['stdio'].getText().strip().rstrip()
|
|
self.setProperty('buildid', buildid)
|
|
except:
|
|
log.msg("Could not find BuildID or BuildID invalid")
|
|
log.msg("Found: %s" % buildid)
|
|
return FAILURE
|
|
return SUCCESS
|