|
9 | 9 | import copy
|
10 | 10 | from datetime import datetime, timedelta
|
11 | 11 | import sys
|
| 12 | +import tempfile |
12 | 13 | import time
|
13 | 14 |
|
14 | 15 | import kernelci.build
|
@@ -138,6 +139,26 @@ def _run_trigger(self, build_config, force, timeout, trees):
|
138 | 139 | def _iterate_trees(self, force, timeout, trees):
|
139 | 140 | for tree in self._trees.keys():
|
140 | 141 | build_configs = {name: config for name, config in self._build_configs.items() if config.tree.name == tree}
|
| 142 | + if not build_configs: |
| 143 | + try: |
| 144 | + # Remove hardcoded remote build config paths |
| 145 | + if tree.url.startswith("https://git.kernel.org"): |
| 146 | + config_url = f"{tree.url}/plain/.kernelci.yaml?h=kernelci" |
| 147 | + elif tree.url.startswith("https://github.com"): |
| 148 | + config_url = f"https://raw.githubusercontent.com/{tree}/linux/refs/heads/kernelci/.kernelci.yaml" |
| 149 | + else: |
| 150 | + raise Exception("Hosting service not supported") |
| 151 | + remote_config = requests.get(config_url) |
| 152 | + except Exception as ex: |
| 153 | + self.log.error(f"Failed to get remote build config for {tree.name}, ignoring") |
| 154 | + self.traceback(ex) |
| 155 | + continue |
| 156 | + with tempfile.NamedTemporaryFile(suffix='.yaml', delete_on_close=False) as tmp: |
| 157 | + tmp.write(remote_config.text.encode()) |
| 158 | + tmp.close() |
| 159 | + # Remove hardcoded trees config path |
| 160 | + tmp_configs = kernelci.config.load(['config/trees.yaml', tmp.name]) |
| 161 | + build_configs = tmp_configs['build_configs'] |
141 | 162 | for name, config in build_configs.items():
|
142 | 163 | self._run_trigger(config, force, timeout, trees)
|
143 | 164 |
|
|
0 commit comments