jobcontrol.config
Objects to manage the configuration.
The configuration object (stored as YAML in the configuration file)
must be a dict. Supported keys for the “main” dict are:
- storage: URL to a supported “state” storage
- webapp: Configuration for the webapp, passed to Flask
- celery: Configuration for celery
- jobs: List of job configuration blocks
- secret: Dictionary of “secrets”, which can be referenced by the configuration
but are never shown on administration pages, ...
-
class jobcontrol.config.JobControlConfig(initial=None)[source]
-
classmethod from_file(filename)[source]
Initialize configuration from a file, or a file-like providing
a read() method.
-
classmethod from_string(s)[source]
Initialize configuration from a string.
The string will first be pre-processed through jinja, then
passed to the from_object() constructor.
-
static preprocess_config(s)[source]
-
storage[source]
-
jobs[source]
-
webapp[source]
-
celery[source]
-
secret[source]
-
get_storage()[source]
-
get_job_config(job_id)[source]
-
get_job(job_id)
-
get_job_deps(job_id)[source]
-
get_job_revdeps(job_id)[source]
-
class jobcontrol.config.BuildConfig(initial=None)[source]
Dict-like object used to hold a build configuration.
Provides some validation on the passed-in configuration
values, plus default values for missing items.
Supported keys are:
- function: a string representing the function to be called,
in the format: "module:function".
- args: a tuple of positional arguments to be passed to
the function.
- kwargs: a dictionary holding keyword arguments to be passed
to the function.
- dependencies: a list of “dependency” job ids.
- pinned_builds: a dictionary mapping dependency job ids to
the “selected” dependency build. This way we can ensure consistency
- title, notes: descriptive fields, shown on the interfaces
- protected: boolean flag indicating whether this job should be
“protected”, i.e. extra care should be taken before running it.
- cleanup_function: a function to be called in order to delete
the output result for this job. It will be passed the BuildInfo
object as only argument.
- repr_function: function to be used to represent the return value
of this build. It will be passed the BuildInfo object as only
argument; return values can be retrieved from the build.retval
argument, configuration from build.app.config.
-
class jobcontrol.config.Retval(job_id)[source]
Placeholder object for !retval <n>