QuasarAppCI/BuildBotLib/basemodule.py

40 lines
754 B
Python
Raw Normal View History

2019-07-22 10:20:59 +03:00
import sys
from buildbot.plugins import util
import multiprocessing
import glob
import shutil
2019-10-06 19:15:02 +03:00
class BaseModule:
def __init__(self):
self;
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
def getFactory(self):
return util.BuildFactory()
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
def getRepo(self):
return "";
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
def getPropertyes(self):
return []
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
def copyRegExp(self, source, dist):
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
res = []
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
for file in glob.glob(source):
res.append(file)
shutil.copy(file, dist)
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
return res;
2019-07-22 10:20:59 +03:00
2019-10-06 19:15:02 +03:00
@util.renderer
def makeCommand(self, props):
command = ['make']
cpus = multiprocessing.cpu_count()
if cpus:
command.extend(['-j', str(cpus)])
else:
command.extend(['-j', '1'])
return command