Read config from .zuul.yaml or zuul.yaml
Repos which exist only for the purpose of providing Zuul configuration and jobs should be able to use the zuul.yaml file even if they are untrusted. Therefore, read both filenames from both kinds of repos. Change-Id: Ib24cbb3a4c8752aa61868c2dbca63141cb35ff51
This commit is contained in:
parent
4bf2cc3448
commit
9ad725a349
|
@ -1134,7 +1134,7 @@ class TenantParser(object):
|
|||
job = merger.getFiles(
|
||||
project.source.connection.connection_name,
|
||||
project.name, branch,
|
||||
files=['.zuul.yaml'])
|
||||
files=['zuul.yaml', '.zuul.yaml'])
|
||||
job.source_context = model.SourceContext(
|
||||
project, branch, '', False)
|
||||
jobs.append(job)
|
||||
|
@ -1324,15 +1324,16 @@ class ConfigLoader(object):
|
|||
def _loadDynamicProjectData(self, config, project, files, trusted):
|
||||
if trusted:
|
||||
branches = ['master']
|
||||
fn = 'zuul.yaml'
|
||||
else:
|
||||
branches = project.source.getProjectBranches(project)
|
||||
fn = '.zuul.yaml'
|
||||
|
||||
for branch in branches:
|
||||
incdata = None
|
||||
data = files.getFile(project.source.connection.connection_name,
|
||||
project.name, branch, fn)
|
||||
for fn in ['zuul.yaml', '.zuul.yaml']:
|
||||
data = files.getFile(project.source.connection.connection_name,
|
||||
project.name, branch, fn)
|
||||
if data:
|
||||
break
|
||||
if data:
|
||||
source_context = model.SourceContext(project, branch,
|
||||
fn, trusted)
|
||||
|
|
Loading…
Reference in New Issue