19 lines
490 B
Python
19 lines
490 B
Python
from pydantic import BaseModel
|
|
from typing import List, Dict
|
|
import yaml
|
|
from pathlib import Path
|
|
|
|
class Pipeline(BaseModel):
|
|
name: str
|
|
requirements: str
|
|
script: List[str]
|
|
|
|
class RunnerScript(BaseModel):
|
|
pipelines: List[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) |