mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-09 05:15:45 -05:00
393 lines
16 KiB
Python
393 lines
16 KiB
Python
# -*- python -*-
|
|
# ex: set syntax=python:
|
|
|
|
# This is a sample buildmaster config file. It must be installed as
|
|
# 'master.cfg' in your buildmaster's base directory.
|
|
|
|
# This is the dictionary that the buildmaster pays attention to. We also use
|
|
# a shorter alias to save typing.
|
|
c = BuildmasterConfig = {}
|
|
|
|
####### BUILDSLAVES
|
|
|
|
# The 'slaves' list defines the set of recognized buildslaves. Each element is
|
|
# a BuildSlave object, specifying a unique slave name and password. The same
|
|
# slave name and password must be configured on the slave.
|
|
from buildbot.buildslave import BuildSlave
|
|
from buildbot_private import pass_dict
|
|
c['slaves'] = [BuildSlave("linux-slave", pass_dict["linux-slave"], max_builds = 1),
|
|
BuildSlave("OSX-slave", pass_dict["OSX-slave"], max_builds = 1),
|
|
BuildSlave("windows-slave", pass_dict["windows-slave"], max_builds = 1)
|
|
]
|
|
|
|
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
|
|
# This must match the value configured into the buildslaves (with their
|
|
# --master option)
|
|
c['slavePortnum'] = 9989
|
|
|
|
####### CHANGESOURCES
|
|
|
|
# the 'change_source' setting tells the buildmaster how it should find out
|
|
# about source code changes. Here we point to the CoolProp source code.
|
|
|
|
from buildbot.changes.gitpoller import GitPoller
|
|
c['change_source'] = []
|
|
c['change_source'].append(GitPoller(
|
|
'https://github.com/CoolProp/CoolProp',
|
|
workdir='gitpoller-workdir', branch='master',
|
|
pollinterval=300)) # Interval between triggering a build
|
|
|
|
####### BUILDERS
|
|
|
|
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
|
|
# what steps, and which slaves can execute them. Note that any particular build will
|
|
# only take place on one slave.
|
|
|
|
from buildbot.process.factory import BuildFactory
|
|
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
|
|
|
|
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=""))
|
|
# Check out sources
|
|
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
|
|
# Run sphinx apidoc
|
|
#factory.addStep(ShellCommand(command=["sphinx-apidoc","-T","-f","-o","apidoc","../CoolProp"],workdir= 'build/Web', haltOnFailure = True))
|
|
# Run sphinx build
|
|
factory.addStep(ShellCommand(command=["make", "html"], workdir= 'build/Web', haltOnFailure = True))
|
|
# Upload the generated files
|
|
factory.addStep(DirectoryUpload(slavesrc="Web/_build/html",masterdest="public_html/sphinx",url="sphinx",compress="bz2"))
|
|
return factory
|
|
|
|
def javascript_slave(platform, cmake_args = [], cmake_env = {}, build_args = [], git_mode = 'incremental'):
|
|
factory = BuildFactory()
|
|
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=""))
|
|
|
|
# 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
|
|
factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True))
|
|
|
|
factory.addStep(ShellCommand(command="cmake .. -DCOOLPROP_JAVASCRIPT_MODULE=ON -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Platform/Emscripten.cmake",
|
|
workdir= working_folder,
|
|
haltOnFailure = True))
|
|
factory.addStep(ShellCommand(command=["cmake", "--build", ".", "--target", "install"]+build_args, workdir = working_folder, haltOnFailure = True))
|
|
factory.addStep(DirectoryUpload(slavesrc="install_root", masterdest="public_html/binaries", url="binaries", compress="bz2"))
|
|
|
|
return factory
|
|
|
|
def python_slave(key, platform, cmake_args = [], cmake_env = {}, build_args = [], git_mode = 'incremental'):
|
|
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 destination\* && for /d %x in (destination\*) do @rd /s /q %x) ')]
|
|
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=""))
|
|
# 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
|
|
factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True))
|
|
|
|
factory.addStep(ShellCommand(command=["cmake", "..", "-DCOOLPROP_PYTHON_"+key+"=ON"]+cmake_args,
|
|
env = cmake_env,
|
|
workdir= working_folder,
|
|
haltOnFailure = True))
|
|
factory.addStep(ShellCommand(command=["cmake", "--build", ".", "--target", "CoolProp"]+build_args, workdir = working_folder, haltOnFailure = True))
|
|
factory.addStep(DirectoryUpload(slavesrc="install_root", masterdest="public_html/binaries", url="binaries", compress="bz2"))
|
|
|
|
return factory
|
|
|
|
def cmake_slave(mod_name, platform, git_mode = 'incremental', install = True, cmake_args = [], build_args = [], ctest_args = [], cmake_env={}, test = True):
|
|
"""
|
|
Parameters
|
|
----------
|
|
mod_name: string
|
|
The module to be built, one of 'Octave','python','Csharp', etc. - turns on the macro -DCOOLPROP_OCTAVE_MODULE=ON for instance if you pass octave
|
|
git_mode: string
|
|
What mode to use, one of 'incremental' or 'full'
|
|
install: bool
|
|
True for install, False for just build
|
|
cmake_args: list of strings
|
|
List of strings of arguments to be passed to cmake (Makefile generating) step
|
|
cmake_env: dictionary (string->string)
|
|
A dictionary including keys that can be set in the build environment
|
|
build_args: list of strings
|
|
List of strings of arguments to be passed to cmake install or build command depending on value of install
|
|
ctest_args: list of strings
|
|
List of strings of arguments to be passed to ctest
|
|
"""
|
|
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=""))
|
|
|
|
# check out the source
|
|
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
|
|
factory.addStep(MakeDirectory(dir=working_folder, haltOnFailure = True))
|
|
factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True))
|
|
factory.addStep(ShellCommand(command=["cmake", "..", "-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args,
|
|
env = cmake_env,
|
|
workdir= working_folder,
|
|
haltOnFailure = True))
|
|
if install:
|
|
factory.addStep(ShellCommand(command=["cmake", "--build", ".", "--target", "install"]+build_args, workdir = working_folder, haltOnFailure = True))
|
|
else:
|
|
factory.addStep(ShellCommand(command=["cmake", "--build", "."]+build_args, workdir = working_folder, haltOnFailure = True))
|
|
if test:
|
|
factory.addStep(ShellCommand(command=["ctest", "--extra-verbose"] + ctest_args, workdir = working_folder, haltOnFailure = True))
|
|
if install:
|
|
factory.addStep(DirectoryUpload(slavesrc="install_root",masterdest="public_html/binaries",url="binaries",compress="bz2"))
|
|
return factory
|
|
|
|
from buildbot.config import BuilderConfig
|
|
|
|
c['builders'] = []
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="Catch-OSX",
|
|
slavenames=["OSX-slave"],
|
|
factory = cmake_slave('Catch', platform = 'OSX', install=False)
|
|
)
|
|
)
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="Sphinx docs",
|
|
slavenames=["linux-slave"],
|
|
factory = sphinx_slave(platform = 'linux')
|
|
)
|
|
)
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="Python-sdist",
|
|
slavenames=["OSX-slave"],
|
|
factory = python_slave("PYPI", platform = 'OSX')
|
|
)
|
|
)
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="Javascript-linux",
|
|
slavenames=["linux-slave"],
|
|
factory = javascript_slave(platform = 'linux')
|
|
)
|
|
)
|
|
|
|
for platform in ['OSX','windows']:
|
|
c['builders'].append(
|
|
BuilderConfig(name="Python-binaries-" + platform,
|
|
slavenames=[platform + "-slave"],
|
|
factory = python_slave("BINARIES", platform = platform)
|
|
)
|
|
)
|
|
|
|
#Common (boring) modules for linux and OSX
|
|
### OSX
|
|
for wrapper in ['Java','MATLAB','Csharp','Octave']:
|
|
for platform in ['OSX', 'linux']:
|
|
c['builders'].append(
|
|
BuilderConfig(name=wrapper+"-"+platform,
|
|
slavenames=[platform + "-slave"],
|
|
factory = cmake_slave(wrapper, platform = platform)
|
|
)
|
|
)
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="64bitDLL-linux",
|
|
slavenames=["linux-slave"],
|
|
factory = cmake_slave('64BIT_SHARED_LIBRARY',
|
|
platform = 'linux',
|
|
test = False
|
|
)
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="64bitDLL-OSX",
|
|
slavenames=["OSX-slave"],
|
|
factory = cmake_slave('64BIT_SHARED_LIBRARY',
|
|
platform = 'OSX',
|
|
test = False
|
|
)
|
|
)
|
|
)
|
|
|
|
c['builders'].append(
|
|
BuilderConfig(name="64bitDLL-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('64BIT_SHARED_LIBRARY',
|
|
test = False,
|
|
platform = 'windows',
|
|
cmake_args=['-G','Visual Studio 10 2010 Win64']
|
|
)
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="32bitCdeclDLL-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('32BIT_CDECL_SHARED_LIBRARY',
|
|
test = False,
|
|
platform = 'windows',
|
|
cmake_args=['-G','Visual Studio 10 2010']
|
|
)
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="32bitStdcallDLL-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('32BIT_STDCALL_SHARED_LIBRARY',
|
|
test = False,
|
|
platform = 'windows',
|
|
cmake_args=['-G','Visual Studio 10 2010']
|
|
)
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="EES-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('EES', platform = 'windows', test = False)
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="Java-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('Java', platform = 'windows', ctest_args = ['-C','Release'])
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="Csharp-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('Csharp', platform = 'windows', ctest_args = ['-C','Release'])
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="Octave-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('Octave', platform = 'windows', ctest_args = ['-C','Release'])
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="MATLAB64-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('MATLAB', platform = 'windows', cmake_args=['-G','Visual Studio 10 2010 Win64'])
|
|
)
|
|
)
|
|
c['builders'].append(
|
|
BuilderConfig(name="MATLAB32-windows",
|
|
slavenames=["windows-slave"],
|
|
factory = cmake_slave('MATLAB', platform = 'windows',
|
|
cmake_env={'MATLAB_ROOT':'c:\Program Files (x86)\MATLAB\R2014a'},
|
|
cmake_args=['-G','Visual Studio 10 2010'])
|
|
)
|
|
)
|
|
|
|
all_builder_names = [builder.name for builder in c['builders']]
|
|
|
|
####### SCHEDULERS
|
|
|
|
from buildbot.schedulers.basic import SingleBranchScheduler
|
|
from buildbot.schedulers.forcesched import ForceScheduler
|
|
from buildbot.changes import filter
|
|
|
|
c['schedulers'] = []
|
|
c['schedulers'].append(SingleBranchScheduler(
|
|
name="all",
|
|
change_filter=filter.ChangeFilter(branch='master'),
|
|
treeStableTimer=None,
|
|
builderNames=all_builder_names))
|
|
c['schedulers'].append(ForceScheduler(
|
|
name="force",
|
|
builderNames=all_builder_names))
|
|
|
|
####### STATUS TARGETS
|
|
|
|
# 'status' is a list of Status Targets. The results of each build will be
|
|
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
|
|
# including web pages, email senders, and IRC bots.
|
|
|
|
c['status'] = []
|
|
|
|
from buildbot.status import html
|
|
from buildbot.status.web import authz, auth
|
|
from buildbot_private import web_auth
|
|
|
|
authz_cfg=authz.Authz(
|
|
# change any of these to True to enable; see the manual for more
|
|
# options
|
|
auth=auth.BasicAuth([(web_auth['user'], web_auth['pass'])]),
|
|
gracefulShutdown = False,
|
|
forceBuild = 'auth', # use this to test your slave once it is set up
|
|
forceAllBuilds = True,
|
|
pingBuilder = False,
|
|
stopBuild = False,
|
|
stopAllBuilds = False,
|
|
cancelPendingBuild = False,
|
|
)
|
|
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
|
|
|
####### PROJECT IDENTITY
|
|
|
|
# the 'title' string will appear at the top of this buildbot
|
|
# installation's html.WebStatus home page (linked to the
|
|
# 'titleURL') and is embedded in the title of the waterfall HTML page.
|
|
|
|
c['title'] = "CoolProp"
|
|
c['titleURL'] = "https://www.coolprop.org"
|
|
|
|
# the 'buildbotURL' string should point to the location where the buildbot's
|
|
# internal web server (usually the html.WebStatus page) is visible. This
|
|
# typically uses the port number set in the Waterfall 'status' entry, but
|
|
# with an externally-visible host name which the buildbot cannot figure out
|
|
# without some help.
|
|
|
|
c['buildbotURL'] = "http://localhost:8010/"
|
|
|
|
####### DB URL
|
|
|
|
c['db'] = {
|
|
# This specifies what database buildbot uses to store its state. You can leave
|
|
# this at its default for all but the largest installations.
|
|
'db_url' : "sqlite:///state.sqlite",
|
|
}
|