Compare commits

..
3 Commits
Author SHA1 Message Date
brb 9513eb488b adapted to new definition 2023-07-06 15:58:25 +02:00
brb a51c49e8f4 adapted to new definition 2023-07-06 15:58:15 +02:00
brb dba476e78a updated definition 2023-07-06 15:58:03 +02:00
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ def handle_event(request: GiteaRequest):
) )
# load runner commands # load runner commands
runner_script = load_runner_script(path=runner_script_path) runner_script = load_runner_script(path=runner_script_path)
for pipeline_name, pipeline_step in runner_script.items(): for pipeline_name, pipeline_step in runner_script.pipelines.items():
print(pipeline_name) print(pipeline_name)
print(pipeline_step) print(pipeline_step)
+4 -1
View File
@@ -9,7 +9,7 @@ class Pipeline(BaseModel):
script: List[str] script: List[str]
class RunnerScript(BaseModel): class RunnerScript(BaseModel):
pipelines: List[Dict[str, Pipeline]] pipelines: Dict[str, Pipeline]
if __name__ == '__main__': if __name__ == '__main__':
path = Path(__file__).parent.parent / 'runner_script.yml' path = Path(__file__).parent.parent / 'runner_script.yml'
@@ -17,3 +17,6 @@ if __name__ == '__main__':
script = yaml.safe_load(fh) script = yaml.safe_load(fh)
runner_script = RunnerScript.parse_obj(script) runner_script = RunnerScript.parse_obj(script)
print(runner_script) print(runner_script)
for k, v in runner_script.pipelines.items():
print(k)
print(v)
+1 -1
View File
@@ -8,5 +8,5 @@ definitions:
- command2 arg1 arg2 - command2 arg1 arg2
pipelines: pipelines:
- default: default:
<<: *step-test <<: *step-test