Skip to content

Commit 2f4f3f1

Browse files
committed
src/trigger.py: Retrieve externally hosted build configurations
Signed-off-by: Paweł Wieczorek <[email protected]>
1 parent ff30182 commit 2f4f3f1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/trigger.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import copy
1010
from datetime import datetime, timedelta
1111
import sys
12+
import tempfile
1213
import time
1314

1415
import kernelci.build
@@ -138,6 +139,19 @@ def _run_trigger(self, build_config, force, timeout, trees):
138139
def _iterate_trees(self, force, timeout, trees):
139140
for tree in self._trees.keys():
140141
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 path
145+
remote_config = requests.get(f'https://raw.githubusercontent.com/{tree}/linux/refs/heads/kernelci/.kernelci.yaml')
146+
except Exception as ex:
147+
self.log.error(f"Failed to get remote build config for {tree.name}, ignoring")
148+
self.traceback(ex)
149+
continue
150+
with tempfile.NamedTemporaryFile(suffix='.yaml', delete_on_close=False) as tmp:
151+
tmp.write(remote_config.text.encode())
152+
tmp.close()
153+
# Remove hardcoded trees config path
154+
build_configs = kernelci.config.load(['config/trees.yaml', tmp.name])
141155
for name, config in build_configs.items():
142156
self._run_trigger(config, force, timeout, trees)
143157

0 commit comments

Comments
 (0)