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
|
build:FUNCTION_NAME:NODE_NAME
|
||||||
|
|
||||||
where **NODE_NAME** is the name or class of node on which the job
|
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
|
should be run.
|
||||||
parameter in a parameter-function (see :ref:`includes` section in
|
|
||||||
:ref:`zuulconf`).
|
|
||||||
|
|
||||||
Zuul sends the ZUUL_* parameters described in `Zuul Parameters`_
|
Zuul sends the ZUUL_* parameters described in `Zuul Parameters`_
|
||||||
encoded in JSON format as the argument included with the
|
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
|
Zuul should perform. There are three sections: pipelines, jobs, and
|
||||||
projects.
|
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
|
Pipelines
|
||||||
"""""""""
|
"""""""""
|
||||||
|
|
||||||
|
@ -800,33 +780,6 @@ each job as it builds a list from the project specification.
|
||||||
|
|
||||||
**tags (optional)**
|
**tags (optional)**
|
||||||
A list of arbitrary strings which will be associated with the job.
|
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**
|
**swift**
|
||||||
If :ref:`swift` is configured then each job can define a destination
|
If :ref:`swift` is configured then each job can define a destination
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import gear
|
import gear
|
||||||
import inspect
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -284,16 +283,6 @@ class LaunchClient(object):
|
||||||
for key, value in swift_instructions.items():
|
for key, value in swift_instructions.items():
|
||||||
params['_'.join(['SWIFT', name, key])] = value
|
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=[]):
|
def launch(self, job, item, pipeline, dependent_items=[]):
|
||||||
uuid = str(uuid4().hex)
|
uuid = str(uuid4().hex)
|
||||||
self.log.info(
|
self.log.info(
|
||||||
|
|
|
@ -50,9 +50,6 @@ class ConfigSchema(object):
|
||||||
|
|
||||||
|
|
||||||
class LayoutSchema(object):
|
class LayoutSchema(object):
|
||||||
include = {'python-file': str}
|
|
||||||
includes = [include]
|
|
||||||
|
|
||||||
manager = v.Any('IndependentPipelineManager',
|
manager = v.Any('IndependentPipelineManager',
|
||||||
'DependentPipelineManager')
|
'DependentPipelineManager')
|
||||||
|
|
||||||
|
@ -129,7 +126,6 @@ class LayoutSchema(object):
|
||||||
'voting': bool,
|
'voting': bool,
|
||||||
'mutex': str,
|
'mutex': str,
|
||||||
'tags': toList(str),
|
'tags': toList(str),
|
||||||
'parameter-function': str,
|
|
||||||
'branch': toList(str),
|
'branch': toList(str),
|
||||||
'files': toList(str),
|
'files': toList(str),
|
||||||
'swift': toList(swift),
|
'swift': toList(swift),
|
||||||
|
|
|
@ -424,7 +424,6 @@ class Job(object):
|
||||||
branch_matcher=None,
|
branch_matcher=None,
|
||||||
file_matcher=None,
|
file_matcher=None,
|
||||||
irrelevant_file_matcher=None, # skip-if
|
irrelevant_file_matcher=None, # skip-if
|
||||||
parameter_function=None, # TODOv3(jeblair): remove
|
|
||||||
tags=set(),
|
tags=set(),
|
||||||
mutex=None,
|
mutex=None,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue