Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9513eb488b | ||
|
|
a51c49e8f4 | ||
|
|
dba476e78a |
+1
-1
@@ -60,7 +60,7 @@ def handle_event(request: GiteaRequest):
|
||||
)
|
||||
# load runner commands
|
||||
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_step)
|
||||
|
||||
|
||||
@@ -9,11 +9,14 @@ class Pipeline(BaseModel):
|
||||
script: List[str]
|
||||
|
||||
class RunnerScript(BaseModel):
|
||||
pipelines: List[Dict[str, Pipeline]]
|
||||
pipelines: Dict[str, Pipeline]
|
||||
|
||||
if __name__ == '__main__':
|
||||
path = Path(__file__).parent.parent / 'runner_script.yml'
|
||||
with open(path, 'r') as fh:
|
||||
script = yaml.safe_load(fh)
|
||||
runner_script = RunnerScript.parse_obj(script)
|
||||
print(runner_script)
|
||||
print(runner_script)
|
||||
for k, v in runner_script.pipelines.items():
|
||||
print(k)
|
||||
print(v)
|
||||
+2
-2
@@ -8,5 +8,5 @@ definitions:
|
||||
- command2 arg1 arg2
|
||||
|
||||
pipelines:
|
||||
- default:
|
||||
<<: *step-test
|
||||
default:
|
||||
<<: *step-test
|
||||
|
||||
Reference in New Issue
Block a user