|
|
@ -972,13 +972,14 @@ class ProjectTemplateParser(object): |
|
|
|
self.schema = self.getSchema() |
|
|
|
self.not_pipelines = ['name', 'description', 'templates', |
|
|
|
'merge-mode', 'default-branch', 'vars', |
|
|
|
'_source_context', '_start_mark'] |
|
|
|
'queue', '_source_context', '_start_mark'] |
|
|
|
|
|
|
|
def getSchema(self): |
|
|
|
job = {str: vs.Any(str, JobParser.job_attributes)} |
|
|
|
job_list = [vs.Any(str, job)] |
|
|
|
|
|
|
|
pipeline_contents = { |
|
|
|
# TODO(tobiash): Remove pipeline specific queue after deprecation |
|
|
|
'queue': str, |
|
|
|
'debug': bool, |
|
|
|
'fail-fast': bool, |
|
|
@ -988,6 +989,7 @@ class ProjectTemplateParser(object): |
|
|
|
project = { |
|
|
|
'name': str, |
|
|
|
'description': str, |
|
|
|
'queue': str, |
|
|
|
'vars': ansible_vars_dict, |
|
|
|
str: pipeline_contents, |
|
|
|
'_source_context': model.SourceContext, |
|
|
@ -1004,11 +1006,13 @@ class ProjectTemplateParser(object): |
|
|
|
project_template = model.ProjectConfig(conf.get('name')) |
|
|
|
project_template.source_context = conf['_source_context'] |
|
|
|
project_template.start_mark = conf['_start_mark'] |
|
|
|
project_template.queue_name = conf.get('queue') |
|
|
|
for pipeline_name, conf_pipeline in conf.items(): |
|
|
|
if pipeline_name in self.not_pipelines: |
|
|
|
continue |
|
|
|
project_pipeline = model.ProjectPipelineConfig() |
|
|
|
project_template.pipelines[pipeline_name] = project_pipeline |
|
|
|
# TODO(tobiash): Remove pipeline specific queue after deprecation |
|
|
|
project_pipeline.queue_name = conf_pipeline.get('queue') |
|
|
|
project_pipeline.debug = conf_pipeline.get('debug') |
|
|
|
project_pipeline.fail_fast = conf_pipeline.get( |
|
|
@ -1063,6 +1067,7 @@ class ProjectParser(object): |
|
|
|
job_list = [vs.Any(str, job)] |
|
|
|
|
|
|
|
pipeline_contents = { |
|
|
|
# TODO(tobiash): Remove pipeline specific queue after deprecation |
|
|
|
'queue': str, |
|
|
|
'debug': bool, |
|
|
|
'fail-fast': bool, |
|
|
@ -1077,6 +1082,7 @@ class ProjectParser(object): |
|
|
|
'merge-mode': vs.Any('merge', 'merge-resolve', |
|
|
|
'cherry-pick', 'squash-merge'), |
|
|
|
'default-branch': str, |
|
|
|
'queue': str, |
|
|
|
str: pipeline_contents, |
|
|
|
'_source_context': model.SourceContext, |
|
|
|
'_start_mark': ZuulMark, |
|
|
@ -1142,6 +1148,8 @@ class ProjectParser(object): |
|
|
|
default_branch = conf.get('default-branch', 'master') |
|
|
|
project_config.default_branch = default_branch |
|
|
|
|
|
|
|
project_config.queue_name = conf.get('queue', None) |
|
|
|
|
|
|
|
variables = conf.get('vars', {}) |
|
|
|
if variables: |
|
|
|
if 'zuul' in variables or 'nodepool' in variables: |
|
|
|