from dataclasses import dataclass import subprocess import os @dataclass class DeployerRequest: repo: str branch: str clone_url: str commit_hash: str DEPLOYERDIR = "/home/drm/live" def handle_request(rq: DeployerRequest): subprocess.Popen( ["sudo", "-E", "./deploy.sh"], env=dict( os.environ, DEPLOYERDIR=DEPLOYERDIR, REPO=rq.repo, BRANCH=rq.branch, CLONE_URL=rq.clone_url, COMMIT_HASH=rq.commit_hash, ), )