use spaces rather then tabs + minor pep8 edits.

This commit is contained in:
Campbell Barton
2011-03-21 22:37:08 +00:00
parent 379f55f54c
commit 4bca2e455d
3 changed files with 122 additions and 110 deletions

View File

@@ -50,6 +50,7 @@ from buildbot.config import BuilderConfig
c['builders'] = [] c['builders'] = []
buildernames = [] buildernames = []
def add_builder(c, name, factory): def add_builder(c, name, factory):
slavenames = [] slavenames = []
@@ -63,30 +64,38 @@ def add_builder(c, name, factory):
# common steps # common steps
def svn_step(): def svn_step():
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender') return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
def lib_svn_step(dir): def lib_svn_step(dir):
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir) return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
def cmake_compile_step(): def cmake_compile_step():
return Compile(command=['make'], workdir='blender') return Compile(command=['make'], workdir='blender')
def cmake_test_step(): def cmake_test_step():
return Test(workdir='blender') # make test return Test(workdir='blender') # make test
def scons_compile_step(): def scons_compile_step():
return Compile(command=['python', 'scons/scons.py'], workdir='blender') return Compile(command=['python', 'scons/scons.py'], workdir='blender')
class SlavePack(ShellCommand): class SlavePack(ShellCommand):
pack_script = 'slave_pack.py' pack_script = 'slave_pack.py'
def start(self): def start(self):
if self.getProperty('buildername').find('scons')>=0: if self.getProperty('buildername').find('scons') >= 0:
self.setCommand(['python', pack_script, 'scons']) self.setCommand(['python', pack_script, 'scons'])
else: else:
self.setCommand(['python', pack_script, 'cmake']) self.setCommand(['python', pack_script, 'cmake'])
ShellCommand.start(self) ShellCommand.start(self)
def file_upload(f, id): def file_upload(f, id):
filename = 'buildbot_upload_' + id + '.zip' filename = 'buildbot_upload_' + id + '.zip'
pack_script = 'slave_pack.py' pack_script = 'slave_pack.py'
@@ -94,11 +103,12 @@ def file_upload(f, id):
f.addStep(FileDownload(name='download', mastersrc=pack_script, slavedest=pack_script)) f.addStep(FileDownload(name='download', mastersrc=pack_script, slavedest=pack_script))
f.addStep(ShellCommand(name='package', command=['python', pack_script], description='packaging', descriptionDone='packaged')) f.addStep(ShellCommand(name='package', command=['python', pack_script], description='packaging', descriptionDone='packaged'))
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100*1024*1024)) f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked')) f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
# linux cmake # linux cmake
def linux_cmake(id): def linux_cmake(id):
f = BuildFactory() f = BuildFactory()
f.addStep(svn_step()) f.addStep(svn_step())
@@ -111,6 +121,7 @@ add_builder(c, 'linux_x86_64_cmake', linux_cmake)
# mac cmake # mac cmake
def mac_cmake(id): def mac_cmake(id):
f = BuildFactory() f = BuildFactory()
f.addStep(svn_step()) f.addStep(svn_step())
@@ -124,6 +135,7 @@ add_builder(c, 'mac_x86_64_cmake', mac_cmake)
# win32 scons # win32 scons
# TODO: add scons test target # TODO: add scons test target
def win32_scons(id): def win32_scons(id):
f = BuildFactory() f = BuildFactory()
@@ -166,16 +178,16 @@ c['status'] = []
from buildbot.status import html from buildbot.status import html
from buildbot.status.web import auth, authz from buildbot.status.web import auth, authz
authz_cfg=authz.Authz( authz_cfg = authz.Authz(
# change any of these to True to enable; see the manual for more # change any of these to True to enable; see the manual for more
# options # options
gracefulShutdown = False, gracefulShutdown=False,
forceBuild = True, # use this to test your slave once it is set up forceBuild=True, # use this to test your slave once it is set up
forceAllBuilds = False, forceAllBuilds=False,
pingBuilder = False, pingBuilder=False,
stopBuild = False, stopBuild=False,
stopAllBuilds = False, stopAllBuilds=False,
cancelPendingBuild = False, cancelPendingBuild=False,
) )
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
@@ -200,4 +212,3 @@ c['buildbotURL'] = "http://builder.blender.org/"
# installations. # installations.
c['db_url'] = "sqlite:///state.sqlite" c['db_url'] = "sqlite:///state.sqlite"

View File

@@ -24,6 +24,7 @@ import shutil
import sys import sys
import zipfile import zipfile
# extension stripping # extension stripping
def strip_extension(filename): def strip_extension(filename):
extensions = ['.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe'] extensions = ['.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe']
@@ -34,6 +35,7 @@ def strip_extension(filename):
return filename return filename
# extract platform from package name # extract platform from package name
def get_platform(filename): def get_platform(filename):
# name is blender-version-platform.extension. we want to get the # name is blender-version-platform.extension. we want to get the
@@ -114,4 +116,3 @@ try:
except Exception, ex: except Exception, ex:
sys.stderr.write('Failed to remove old packages: ' + str(ex) + '\n') sys.stderr.write('Failed to remove old packages: ' + str(ex) + '\n')
sys.exit(1) sys.exit(1)

View File

@@ -25,6 +25,7 @@ import subprocess
import sys import sys
import zipfile import zipfile
# find release directory # find release directory
def find_release_directory(): def find_release_directory():
for d in os.listdir('.'): for d in os.listdir('.'):
@@ -84,4 +85,3 @@ try:
except Exception, ex: except Exception, ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n') sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1) sys.exit(1)