Compare commits
3
Commits
87a738461c
...
9513eb488b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9513eb488b | ||
|
|
a51c49e8f4 | ||
|
|
dba476e78a |
+1
-1
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -8,5 +8,5 @@ definitions:
|
|||||||
- command2 arg1 arg2
|
- command2 arg1 arg2
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
- default:
|
default:
|
||||||
<<: *step-test
|
<<: *step-test
|
||||||
|
|||||||
Reference in New Issue
Block a user