Merge "Remove includes and parameter functions" into feature/zuulv3
This commit is contained in:
commit
878ea83690
|
@ -273,9 +273,7 @@ instead invoke:
|
|||
build:FUNCTION_NAME:NODE_NAME
|
||||
|
||||
where **NODE_NAME** is the name or class of node on which the job
|
||||
should be run. This can be specified by setting the ZUUL_NODE
|
||||
parameter in a parameter-function (see :ref:`includes` section in
|
||||
:ref:`zuulconf`).
|
||||
should be run.
|
||||
|
||||
Zuul sends the ZUUL_* parameters described in `Zuul Parameters`_
|
||||
encoded in JSON format as the argument included with the
|
||||
|
|
|
@ -261,26 +261,6 @@ and projects are defined, what tests should be run, and what actions
|
|||
Zuul should perform. There are three sections: pipelines, jobs, and
|
||||
projects.
|
||||
|
||||
.. _includes:
|
||||
|
||||
Includes
|
||||
""""""""
|
||||
|
||||
Custom functions to be used in Zuul's configuration may be provided
|
||||
using the ``includes`` directive. It accepts a list of files to
|
||||
include, and currently supports one type of inclusion, a python file::
|
||||
|
||||
includes:
|
||||
- python-file: local_functions.py
|
||||
|
||||
**python-file**
|
||||
The path to a python file (either an absolute path or relative to the
|
||||
directory name of :ref:`layout_config <layout_config>`). The
|
||||
file will be loaded and objects that it defines will be placed in a
|
||||
special environment which can be referenced in the Zuul configuration.
|
||||
Currently only the parameter-function attribute of a Job uses this
|
||||
feature.
|
||||
|
||||
Pipelines
|
||||
"""""""""
|
||||
|
||||
|
@ -800,33 +780,6 @@ each job as it builds a list from the project specification.
|
|||
|
||||
**tags (optional)**
|
||||
A list of arbitrary strings which will be associated with the job.
|
||||
Can be used by the parameter-function to alter behavior based on
|
||||
their presence on a job. If the job name is a regular expression,
|
||||
tags will accumulate on jobs that match.
|
||||
|
||||
**parameter-function (optional)**
|
||||
Specifies a function that should be applied to the parameters before
|
||||
the job is launched. The function should be defined in a python file
|
||||
included with the :ref:`includes` directive. The function
|
||||
should have the following signature:
|
||||
|
||||
.. function:: parameters(item, job, parameters)
|
||||
|
||||
Manipulate the parameters passed to a job before a build is
|
||||
launched. The ``parameters`` dictionary will already contain the
|
||||
standard Zuul job parameters, and is expected to be modified
|
||||
in-place.
|
||||
|
||||
:param item: the current queue item
|
||||
:type item: zuul.model.QueueItem
|
||||
:param job: the job about to be run
|
||||
:type job: zuul.model.Job
|
||||
:param parameters: parameters to be passed to the job
|
||||
:type parameters: dict
|
||||
|
||||
If the parameter **ZUUL_NODE** is set by this function, then it will
|
||||
be used to specify on what node (or class of node) the job should be
|
||||
run.
|
||||
|
||||
**swift**
|
||||
If :ref:`swift` is configured then each job can define a destination
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
# under the License.
|
||||
|
||||
import gear
|
||||
import inspect
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
@ -284,16 +283,6 @@ class LaunchClient(object):
|
|||
for key, value in swift_instructions.items():
|
||||
params['_'.join(['SWIFT', name, key])] = value
|
||||
|
||||
if callable(job.parameter_function):
|
||||
pargs = inspect.getargspec(job.parameter_function)
|
||||
if len(pargs.args) == 2:
|
||||
job.parameter_function(item, params)
|
||||
else:
|
||||
job.parameter_function(item, job, params)
|
||||
self.log.debug("Custom parameter function used for job %s, "
|
||||
"change: %s, params: %s" % (job, item.change,
|
||||
params))
|
||||
|
||||
def launch(self, job, item, pipeline, dependent_items=[]):
|
||||
uuid = str(uuid4().hex)
|
||||
self.log.info(
|
||||
|
|
|
@ -50,9 +50,6 @@ class ConfigSchema(object):
|
|||
|
||||
|
||||
class LayoutSchema(object):
|
||||
include = {'python-file': str}
|
||||
includes = [include]
|
||||
|
||||
manager = v.Any('IndependentPipelineManager',
|
||||
'DependentPipelineManager')
|
||||
|
||||
|
@ -129,7 +126,6 @@ class LayoutSchema(object):
|
|||
'voting': bool,
|
||||
'mutex': str,
|
||||
'tags': toList(str),
|
||||
'parameter-function': str,
|
||||
'branch': toList(str),
|
||||
'files': toList(str),
|
||||
'swift': toList(swift),
|
||||
|
|
|
@ -424,7 +424,6 @@ class Job(object):
|
|||
branch_matcher=None,
|
||||
file_matcher=None,
|
||||
irrelevant_file_matcher=None, # skip-if
|
||||
parameter_function=None, # TODOv3(jeblair): remove
|
||||
tags=set(),
|
||||
mutex=None,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue