blob: 3edfe1283c84a9ec731bf9e3dda2f3bc1145c12e [file] [log] [blame]
Mohammed Naserebcd7d72024-06-20 11:42:28 -04001import sys
2import glob
3import yaml
4
5
6def main():
7 passed = True
8
9 for file in glob.glob("zuul.d/container-images/*.yaml"):
10 with open(file, "r") as file:
11 configs = yaml.safe_load(file)
12
13 for config in configs:
14 if "job" in config:
15 job = config["job"]
16
17 # Check if build or upload jobs are missing 'atmosphere-buildset-registry' dependency
18 if (
19 "build-container-image-" in job["name"]
20 or "upload-container-image-" in job["name"]
21 ):
22 deps = job.get("dependencies", [])
23 if not any(
24 dep.get("name") == "atmosphere-buildset-registry"
25 for dep in deps
26 ):
27 print(
28 f"Job '{job['name']}' is missing 'atmosphere-buildset-registry' dependency."
29 )
30 passed = False
31
32 if passed:
33 print(
34 "All build and upload jobs have 'atmosphere-buildset-registry' dependency."
35 )
36 else:
37 print("Jobs missing 'atmosphere-buildset-registry' dependency.")
38 sys.exit(1)
39
40
41if __name__ == "__main__":
42 main()