This commit is contained in:
2025-01-07 22:20:02 -05:00
parent c3ef3f2dd5
commit 14f9bb557d
5 changed files with 21 additions and 18 deletions

View File

@@ -6,17 +6,20 @@ import os
class DeployerRequest:
repo: str
branch: str
clone_url: str
commit_hash: str
DEPLOYERDIR = "/home/drm/deployer/production"
def handle_request(rq: DeployerRequest):
subprocess.run(
["./deploy.sh"],
env=dict(
os.environ,
REPO=rq.repo,
BRANCH=rq.branch,
COMMIT_HASH=rq.commit_hash,
),
)
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,
),
)