defined runner script
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user