buildbot master now can do full cleans by setting property fullclean to yes in the web UI

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-08 18:51:44 +02:00
parent 1aec75df85
commit 39abcc5193

View File

@@ -48,21 +48,41 @@ from buildbot.steps.source.git import Git
from buildbot.steps.shell import ShellCommand
from buildbot.steps.slave import MakeDirectory, RemoveDirectory
from buildbot.steps.transfer import DirectoryUpload
from buildbot.process import properties
"""
from http://ss64.com/nt/del.html
deltree.cmd script, save it somewhere on the system PATH on windows
:: DelTree.cmd
:: Remove all files and subfolders but NOT the root folder
:: From tip 617 at JsiFAQ.com
@echo off
if "%1"=="" goto:eof
pushd %1
del /q *.*
for /f "Tokens=*" %%G in ('dir /B') do rd /s /q "%%G"
popd
"""
@properties.renderer
def cleanCommand(props):
fullclean = props.getProperty('fullclean', default = 'no') == 'yes'
is_windows = props.getProperty('slavename').find('windows') >= 0
if fullclean:
if is_windows:
command = ['deltree','.','&&','echo','fully cleaned']
else:
command = ['rm','-rfv','*','&&','echo','fully cleaned']
else:
command = ['echo','no clean requested', props.getProperty('fullclean')]
return command
def sphinx_slave(platform, git_mode = 'incremental'):
factory = BuildFactory()
from buildbot.process.properties import WithProperties
# Was the build started from the force build form with a "fullclean"
# property set? If so, clobber the checkout folders.
if platform.startswith('win'):
# del /q destination\* && for /d %x in (destination\*) do @rd /s /q %x
cmd = []#['cmd', '/c', WithProperties('"IF %(fullclean:-no)s == yes (echo %CD%)"')]
else:
cmd = ['bash', '-c',
WithProperties('if [ %(fullclean:-no)s == yes ]; then echo `pwd`; rm -rfv build; echo fully cleaned; fi'),
]
factory.addStep(ShellCommand(command=cmd, description='fullclean?', workdir=""))
factory.addStep(ShellCommand(command=cleanCommand, description='fullclean?', workdir=""))
# Check out sources
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
# Run sphinx apidoc
@@ -78,16 +98,8 @@ def javascript_slave(platform, cmake_args = [], cmake_env = {}, build_args = [],
working_folder = "build/Javascript"
from buildbot.process.properties import WithProperties
# Was the build started from the force build form with a "fullclean"
# property set? If so, clobber the checkout folders.
if platform.startswith('win'):
# del /q destination\* && for /d %x in (destination\*) do @rd /s /q %x
cmd = []#['cmd', '/c', WithProperties('"IF %(fullclean:-no)s == yes (echo %CD%)"')]
else:
cmd = ['bash', '-c',
WithProperties('if [ %(fullclean:-no)s == yes ]; then echo `pwd`; rm -rfv build; echo fully cleaned; fi'),
]
factory.addStep(ShellCommand(command=cmd, description='fullclean?', workdir=""))
factory.addStep(ShellCommand(command=cleanCommand, description='fullclean?', workdir=""))
# Check out sources
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
@@ -106,17 +118,7 @@ def python_slave(key, platform, cmake_args = [], cmake_env = {}, build_args = []
factory = BuildFactory()
working_folder = "build/Python_" + key
from buildbot.process.properties import WithProperties
# Was the build started from the force build form with a "fullclean"
# property set? If so, clobber the checkout folders.
if platform.startswith('win'):
# del /q destination\* && for /d %x in (destination\*) do @rd /s /q %x
cmd =[]# ['cmd', '/c', WithProperties('if %(fullclean:-no)s == no (del /q *) ')]
else:
cmd = ['bash', '-c',
WithProperties('if [ %(fullclean:-no)s == yes ]; then echo pwd; rm -rfv *; echo fully cleaned; fi'),
]
factory.addStep(ShellCommand(command=cmd, description='fullclean?', workdir=""))
factory.addStep(ShellCommand(command=cleanCommand, description='fullclean?', workdir=""))
# Check out sources
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
# Remove the temporary folder for installs
@@ -153,17 +155,7 @@ def cmake_slave(mod_name, platform, git_mode = 'incremental', install = True, cm
factory = BuildFactory()
working_folder = "build/build"
from buildbot.process.properties import WithProperties
# Was the build started from the force build form with a "fullclean"
# property set? If so, clobber the checkout folders.
if platform.startswith('win'):
# del /q destination\* && for /d %x in (destination\*) do @rd /s /q %x
cmd = []#['cmd', '/c', WithProperties('"IF %(fullclean:-no)s == yes (echo %CD%)"')]
else:
cmd = ['bash', '-c',
WithProperties('if [ %(fullclean:-no)s == yes ]; then echo pwd; rm -rf *; echo fully cleaned; fi'),
]
factory.addStep(ShellCommand(command=cmd, description='fullclean?', workdir=""))
factory.addStep(ShellCommand(command=cleanCommand, description='fullclean?', workdir=""))
# check out the source
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
@@ -226,7 +218,9 @@ for platform in ['OSX', 'linux', 'windows']:
BuilderConfig(name=wrapper + "-" + platform,
slavenames=[platform + "-slave"],
factory = cmake_slave(wrapper,
platform = platform)
platform = platform,
ctest_args = ctest_args,
cmake_args = cmake_args)
)
)
c['builders'].append(
@@ -245,7 +239,7 @@ c['builders'].append(
cmake_args=['-G','Visual Studio 10 2010']
)
)
)
)
c['builders'].append(
BuilderConfig(name="32bitStdcallDLL-windows",
slavenames=["windows-slave"],
@@ -255,7 +249,7 @@ c['builders'].append(
cmake_args=['-G','Visual Studio 10 2010']
)
)
)
)
c['builders'].append(
BuilderConfig(name="EES-windows",
slavenames=["windows-slave"],