Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def gen_git_updated_valgrind_factory(repourl, configure_opts=[]):
"""
Factory for doing build from git master, without cleaning first, and using
valgrind to check. This one is much more expensive, so should be run with
a higher stable time.
"""
f = factory.BuildFactory()
f.addStep(source.Git(repourl=repourl, mode="update"))
f.addStep(Bootstrap())
configure_opts.append("--disable-documentation")
f.addStep(shell.Configure(command = ["sh", "configure", "CXXFLAGS=-O0 -g"] + configure_opts))
f.addStep(shell.Compile())
f.addStep(shell.Test(name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"], workdir='build/xapian-core'))
return f
def addSimpleBuilder(self, name, buildername, category, repourl, builderconfig, sos, sbranch, bparams):
"""Private.
Add a single builder on the given OS type for the given repo and branch.
"""
factory = BuildFactory()
factory.addStep(Git(repourl=repourl, mode='full', submodules=True,
method='copy', branch=sbranch, getDescription={'tags': True}))
if "tag" in builderconfig and not(builderconfig["tag"] is None):
stag = builderconfig["tag"].encode('ascii', 'ignore')
factory.addStep(ShellCommand(
command=['git', 'checkout', stag],
workdir="build",
description="checkout tag"))
# Delegate all knowlege of how to build to a script called buildshim in the project
# directory. Call this script in nine standardize steps. It should ignore steps that it doesn't need.
# Pass the step name as the first arg, and if params was given in the json for this builder, pass that as the
# second arg.
for step in ["patch", "install_deps", "configure", "compile", "check", "package", "upload", "compile_extra", "uninstall_deps"]:
factory.addStep(ShellCommand(
command=["./buildshim", step, bparams], description=step, haltOnFailure=True))
def ros_debbuild(c, job_name, packages, url, distro, arch, rosdistro, version, machines, othermirror, keys, trigger_pkgs = None):
gbp_args = ['-uc', '-us', '--git-ignore-branch', '--git-ignore-new',
'--git-verbose', '--git-dist='+distro, '--git-arch='+arch]
f = BuildFactory()
# Remove the build directory.
f.addStep(
RemoveDirectory(
name = job_name+'-clean',
dir = Interpolate('%(prop:workdir)s'),
hideStepIf = success,
)
)
# Check out the repository master branch, since releases are tagged and not branched
f.addStep(
Git(
repourl = url,
branch = 'master',
alwaysUseLatest = True, # this avoids broken builds when schedulers send wrong tag/rev
mode = 'full' # clean out old versions
)
jobs_cmd = ["-j"+str(jobs)]
build_cmd = [make] + jobs_cmd
install_cmd = [make, 'install'] + jobs_cmd
check_all_cmd = [make, 'check-all'] + jobs_cmd
check_polly_cmd = [make, 'check-polly'] + jobs_cmd
cmake_install = []
if install:
cmake_install = ["-DCMAKE_INSTALL_PREFIX=../%s" % llvm_instdir]
# Prepare environmental variables. Set here all env we want everywhere.
merged_env = {
'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences.
}
if env:
merged_env.update(env) # Overwrite pre-set items with the given ones, so user can set anything.
f = buildbot.process.factory.BuildFactory()
# Determine the build directory.
f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir",
command=["pwd"],
property="builddir",
description="set build dir",
workdir="."))
# Get LLVM, Clang and Polly
f.addStep(SVN(name='svn-llvm',
mode='update',
baseURL='http://llvm.org/svn/llvm-project/llvm/',
defaultBranch='trunk',
workdir=llvm_srcdir))
f.addStep(SVN(name='svn-clang',
mode='update',
baseURL='http://llvm.org/svn/llvm-project/cfe/',
defaultBranch='trunk',
from buildbot.process.factory import BuildFactory
from buildbot.steps.source import Git
from buildbot.steps.shell import ShellCommand
job_test_urls = ['pbs+ssh://india.futuregrid.org', 'pbs+ssh://alamo.futuregrid.org']
activate_keychain = "keychain $HOME/.ssh/id_rsa && source $HOME/.keychain/faust-sh"
activate_venv = ". blissenv/bin/activate"
factory = BuildFactory()
import factory_common_steps
factory.addStep(factory_common_steps.run_git_checkout)
factory.addStep(factory_common_steps.run_bootstrap_virtualenv)
factory.addStep(factory_common_steps.run_pip_install)
factory.addStep(factory_common_steps.run_unittests)
# check if the keychain is active. fail and skip remaining tests if not.
factory.addStep(factory_common_steps.run_check_keychain)
for url in job_test_urls:
factory.addStep(ShellCommand(command=["/bin/bash", "-l", "-c" ,"%s && SAGA_VERBOSE=5 python ./test/compliance/job/01_run_remote_exe.py %s" % (activate_venv+" && "+activate_keychain, url)],
description="Running test: job/01_run_remote_exe.py %s" % (url), name="test_job/01"))
def getSanitizerWindowsBuildFactory(
clean=False,
cmake='cmake',
# Default values for VS devenv and build configuration
vs=r"""%VS120COMNTOOLS%""",
config='Release',
target_arch='x86',
extra_cmake_args=[]):
############# PREPARING
f = buildbot.process.factory.BuildFactory()
# Kill any stale symbolizer processes for the last run. If there are any
# stale processes, the build will fail during linking. This can happen to
# any process, but it is most likely to happen to llvm-symbolizer if its
# pipe isn't closed.
taskkill_cmd = 'taskkill /f /im llvm-symbolizer.exe || exit /b 0'
f.addStep(ShellCommand(name='taskkill',
description='kill stale processes',
command=['cmd', '/c', taskkill_cmd],
haltOnFailure=False))
# Determine Slave Environment and Set MSVC environment.
f.addStep(SetProperty(
command=getVisualStudioEnvironment(vs, target_arch),
extract_fn=extractSlaveEnvironment))
def PublishGoodBuild(f=None, validated_build_dir='validated_builds',
publish_only_latest=False):
import config.phase_config
reload(config.phase_config)
artifacts_dir = set_config_option('Master Options', 'artifacts_path',
os.path.expanduser('~/artifacts/'))
# TODO: Add steps to prepare a release and announce a good build.
if f is None:
f = buildbot.process.factory.BuildFactory()
# Buildbot uses got_revision instead of revision to identify builds.
# We set it below so that the revision shows up in the html status pages.
setProperty(f, 'got_revision', WithProperties('%(revision)s'))
f.addStep(MasterShellCommand(
name='create.dir.validated_build_dir',
command = ['mkdir', '-p',
os.path.join(artifacts_dir, validated_build_dir)],
haltOnFailure = True,
description = ['create', validated_build_dir, 'dir']))
for phase in config.phase_config.phases:
for build in phase['builders']:
buildname = build['name']
project = _project_from_name(buildname)
nightly_kwargs = {}
# we take the defaults of Nightly, except for hour
for arg in ('minute', 'dayOfMonth', 'month', 'dayOfWeek'):
if arg in kwargs:
nightly_kwargs[arg] = kwargs[arg]
self.schedulers.append(Nightly(
name=JANITOR_NAME, builderNames=[JANITOR_NAME], hour=hour, **nightly_kwargs))
self.schedulers.append(ForceScheduler(
name=JANITOR_NAME + "_force",
builderNames=[JANITOR_NAME]))
self.builders.append(BuilderConfig(
name=JANITOR_NAME, workername=JANITOR_NAME, factory=BuildFactory(steps=[
LogChunksJanitor(logHorizon=logHorizon)
])
))
self.protocols.setdefault('null', {})
self.workers.append(LocalWorker(JANITOR_NAME))
def make_factory(branch, python, database):
"""
Generates the BuildFactory (e.g. set of build steps) for this (branch,
python, database) combo. The series of steps is described in the module
docstring, above.
"""
f = BuildFactory()
f.addSteps([
buildsteps.DjangoSVN(branch=branch),
buildsteps.DownloadVirtualenv(),
buildsteps.UpdateVirtualenv(python=python, db=database),
buildsteps.GenerateSettings(python=python, db=database),
buildsteps.TestDjango(python=python, db=database, verbosity=1),
])
return f
scheduler=job_name,
))
properties = dict(TRAVIS_PULL_REQUEST=False)
properties.update(self.properties)
self.config['builders'].append(BuilderConfig(
name=spawner_name,
workernames=self.get_spawner_workers(),
properties=properties,
tags=uniq(["trunk", name] + tags),
factory=f
))
# no need for deployment builder if no stage is configured
if kwargs.get('stages', []):
# Define the builder for the deployment of the project
f = factory.BuildFactory()
vcsManager.addSourceSteps(f)
f.addStep(TravisSetupSteps())
# To manage deployment properly (with change traceability),
# we need the version and the target deployment environment or "stage"
version = StringParameter(
name='version',
label='GIT tag',
hide=False,
required=False,
size=20)
stage = StringParameter(
name='stage',
label='Stage',
hide=False,
required=False,