bhearsum%mozilla.com 3459ac9e27 bug 377929: mozilla2 buildbot master setup - BuildSteps for uploading builds to stage & getting the build id from a build. r=rhelmer,cf, patch=me
git-svn-id: svn://10.0.0.236/trunk@245728 18797224-902f-48f8-a5cc-f745e15eee43
2008-02-14 20:24:40 +00:00

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