| Index: scripts/master/factory/kitchen_factory.py
|
| diff --git a/scripts/master/factory/kitchen_factory.py b/scripts/master/factory/kitchen_factory.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..349b72eda0c293e2866d08d9f090b0493463e914
|
| --- /dev/null
|
| +++ b/scripts/master/factory/kitchen_factory.py
|
| @@ -0,0 +1,51 @@
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +from master.factory import annotator_commands
|
| +from master.factory import commands
|
| +from master.factory.build_factory import BuildFactory
|
| +
|
| +
|
| +def KitchenFactory(active_master, repository, recipe,
|
| + revision='origin/master', factory_properties=None,
|
| + timeout=1200, max_time=2400):
|
| + """Returns buildbot build factory which runs recipes locally using kitchen.
|
| +
|
| + |active_master| is config_bootstrap.Master's subclass from master's
|
| + master_site_config.py .
|
| +
|
| + |repository| is the URL of repository containing recipe to run.
|
| +
|
| + |recipe| is the name of the recipe to pass to kitchen_run.
|
| +
|
| + |revision| is the revision to use for repo checkout (by default we use latest
|
| + revision).
|
| +
|
| + |factory_properties| is a dictionary of default build properties.
|
| +
|
| + |timeout| refers to the maximum number of seconds a build should be allowed
|
| + to run without output. After no output for |timeout| seconds, the build is
|
| + forcibly killed.
|
| +
|
| + |max_time| refers to the maximum number of seconds a build should be allowed
|
| + to run, regardless of output. After |max_time| seconds, the build is
|
| + forcibly killed.
|
| + """
|
| + factory = BuildFactory(build_inherit_factory_properties=False)
|
| + factory.properties.update(factory_properties or {}, 'KitchenFactory')
|
| + cmd_obj = annotator_commands.AnnotatorCommands(
|
| + factory, active_master=active_master)
|
| +
|
| + runner = cmd_obj.PathJoin(cmd_obj.script_dir, 'kitchen_run.py')
|
| + cmd = [
|
| + cmd_obj.python, '-u', runner,
|
| + '--repository', repository,
|
| + '--revision', revision,
|
| + '--recipe', recipe,
|
| + ]
|
| + cmd = cmd_obj.AddB64GzBuildProperties(cmd)
|
| +
|
| + cmd_obj.AddAnnotatedScript(cmd, timeout=timeout, max_time=max_time)
|
| +
|
| + return factory
|
|
|