mirror of
https://github.com/lubuntu-team/ci-tooling.git
synced 2025-07-06 20:41:29 +00:00
Define new jobs by their config name, not by their job type.
This commit is contained in:
parent
d052943e6d
commit
a145c02dde
@ -227,8 +227,8 @@ class Generator:
|
|||||||
view = server.views.create(view)
|
view = server.views.create(view)
|
||||||
|
|
||||||
# Only add to the view if it's not already in there
|
# Only add to the view if it's not already in there
|
||||||
if not job_name in server.views[view]:
|
if not name in server.views[view]:
|
||||||
view.add_job(job_name)
|
view.add_job(name)
|
||||||
|
|
||||||
def create_jenkins_jobs(self):
|
def create_jenkins_jobs(self):
|
||||||
"""Interface with Jenkins to create the jobs required
|
"""Interface with Jenkins to create the jobs required
|
||||||
@ -253,22 +253,24 @@ class Generator:
|
|||||||
|
|
||||||
total_rel = set()
|
total_rel = set()
|
||||||
|
|
||||||
configs = {"merger": [], "stable": [], "unstable": []}
|
configs = {"merger": {}, "stable": {}, "unstable": {}}
|
||||||
# Sort config names into different categories
|
# Sort config names into different categories
|
||||||
for config in metadata["active_configs"]:
|
for config in metadata["active_configs"]:
|
||||||
config_name = config
|
config_name = config
|
||||||
config = metadata["active_configs"][config]
|
config = metadata["active_configs"][config]
|
||||||
for config_type in configs:
|
for config_type in configs:
|
||||||
if config["default"]["type"] == config_type:
|
if config["default"]["type"] == config_type:
|
||||||
configs[config_type].append(metadata["active_configs"][config_name].copy())
|
configs[config_type][config_name] = metadata["active_configs"][config_name].copy()
|
||||||
|
|
||||||
|
|
||||||
# Create the merger jobs first
|
# Create the merger jobs first
|
||||||
for config in configs["merger"]:
|
for config in configs["merger"]:
|
||||||
|
config_name = config
|
||||||
|
config = configs["merger"][config]
|
||||||
parent = metadata["active_configs"][config["default"]["parent"]]
|
parent = metadata["active_configs"][config["default"]["parent"]]
|
||||||
for package in parent["repositories"]:
|
for package in parent["repositories"]:
|
||||||
package["cascade"] = config["default"]["cascade"]
|
package["cascade"] = config["default"]["cascade"]
|
||||||
name = "merger_" + package["name"]
|
name = config_name + "_" + package["name"]
|
||||||
p_config = self.load_config("merger", package)
|
p_config = self.load_config("merger", package)
|
||||||
self.create_jenkins_job(server, p_config, name, "merger")
|
self.create_jenkins_job(server, p_config, name, "merger")
|
||||||
|
|
||||||
@ -276,6 +278,8 @@ class Generator:
|
|||||||
for job_type in ["stable", "unstable"]:
|
for job_type in ["stable", "unstable"]:
|
||||||
# This is the actual loop
|
# This is the actual loop
|
||||||
for config in configs[job_type]:
|
for config in configs[job_type]:
|
||||||
|
config_name = config
|
||||||
|
config = configs[job_type][config]
|
||||||
# Loop on the individual packages
|
# Loop on the individual packages
|
||||||
for package in config["repositories"]:
|
for package in config["repositories"]:
|
||||||
# Loop on each release
|
# Loop on each release
|
||||||
@ -288,7 +292,7 @@ class Generator:
|
|||||||
# Get the package config from the template
|
# Get the package config from the template
|
||||||
p_config = self.load_config("package-" + job_type,
|
p_config = self.load_config("package-" + job_type,
|
||||||
package)
|
package)
|
||||||
name = "%s_%s_%s" % (release, job_type,
|
name = "%s_%s_%s" % (release, config_name,
|
||||||
package["name"])
|
package["name"])
|
||||||
view_name = release + " " + job_type
|
view_name = release + " " + job_type
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user