diff --git a/code/app.py b/code/app.py index e277b54..f319d49 100644 --- a/code/app.py +++ b/code/app.py @@ -79,7 +79,13 @@ def handle_event(request: GiteaRequest): requirements_path = local_repo_dir / pipeline.requirements os.system(f'pip install -r {requirements_path}') for cmd in pipeline.script: - print(cmd) + try: + os.system(cmd) + except Exception as e: + raise HTTPException( + status_code=503, + detail=f'failed running {cmd}: {e}' + ) # send response raise HTTPException(