1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
'''
Created on Feb 24, 2015
__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2015, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "pidge@toganlabs.com"
'''
from buildbot.steps.shell import ShellCommand
from buildbot.process.buildstep import LogLineObserver
from buildbot.status.results import SUCCESS, SKIPPED
class CheckForMinnow(ShellCommand):
haltOnFailure = False
flunkOnFailure = True
name = "CheckForMinnow"
def __init__(self, factory, argdict=None, **kwargs):
self.factory = factory
for k, v in argdict.iteritems():
setattr(self, k, v)
# Timeout needs to be passed to LoggingBuildStep as a kwarg
self.timeout = 100000
kwargs['timeout']=self.timeout
ShellCommand.__init__(self, **kwargs)
def start(self):
# minnowboard breaks, right about here
self.command = "git log --pretty=format:'%H' |grep 19e06e6584ab2aa31709bcf8fe7b566cafd297e7"
self.description = ["Checking for working minnowboard"]
ShellCommand.start(self)
def commandComplete(self, cmd):
result = cmd.logs['stdio'].getText()
minnowExists = ""
try:
minnowExists = result.split()[-1]
except:
self.setProperty('minnowExists', "True", "Minnowboard Builds.")
self.finished(SUCCESS)
if minnowExists == "19e06e6584ab2aa31709bcf8fe7b566cafd297e7":
self.setProperty('minnowExists', "False", "Minnowboard Does Not Build.")
self.finished(SUCCESS)
self.build.allStepsDone()
def getText(self, cmd, results):
return ShellCommand.getText(self, cmd, results)
|