22 lines
441 B
Python
22 lines
441 B
Python
from dataclasses import dataclass
|
|
import subprocess
|
|
import os
|
|
|
|
@dataclass
|
|
class DeployerRequest:
|
|
repo: str
|
|
branch: str
|
|
commit_hash: str
|
|
|
|
|
|
|
|
def handle_request(rq: DeployerRequest):
|
|
subprocess.run(
|
|
["./deploy.sh"],
|
|
env=dict(
|
|
os.environ,
|
|
REPO=rq.repo,
|
|
BRANCH=rq.branch,
|
|
COMMIT_HASH=rq.commit_hash,
|
|
),
|
|
) |