This commit is contained in:
2025-08-03 11:46:12 -04:00
parent 2e734ddea9
commit bc0a9e52e3
4 changed files with 8 additions and 22 deletions

View File

@@ -9,3 +9,6 @@ build:
start: start:
sudo venv/bin/waitress-serve --host 0.0.0.0 --port $(PORT) listen:app sudo venv/bin/waitress-serve --host 0.0.0.0 --port $(PORT) listen:app
deploy_self:
venv/bin/python deploy_self.py

View File

@@ -1,8 +0,0 @@
starting build from root/: ()
fatal: repository './src' does not exist
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
make: *** No rule to make target 'build'. Stop.
build complete!
Failed to restart deployer-.service: Unit deployer-.service not found.

View File

@@ -10,7 +10,7 @@ class DeployerRequest:
user: str user: str
repo: str repo: str
branch: str branch: str
commit_hash: str commit_hash: str = ""
DEPLOYERDIR = "/home/drm/live" DEPLOYERDIR = "/home/drm/live"
@@ -43,22 +43,14 @@ def handle_request(rq: DeployerRequest):
domain_dir = f"{DEPLOYERDIR}/{domain}" domain_dir = f"{DEPLOYERDIR}/{domain}"
logs_dir = f"{domain_dir}/logs/{deployment_id}" logs_dir = f"{domain_dir}/logs/{deployment_id}"
os.makedirs(logs_dir, exist_ok=True)
build_log = f"{logs_dir}/build.log" build_log = f"{logs_dir}/build.log"
subprocess.Popen( subprocess.Popen(
[ ["./deploy.sh"],
"tmux",
"new-session",
"-L", # pass environment variables
"-d", # detach
"-s", # name
f"{domain}-build-{deployment_id}",
f"'sudo ./deploy.sh > {build_log} 2>&1'",
],
shell=True,
user="root", user="root",
stdout=open(build_log, "w"),
stderr=open(build_log, "a"),
shell=True,
env=dict( env=dict(
os.environ, os.environ,
DOMAIN=domain, DOMAIN=domain,

View File

@@ -6,6 +6,5 @@ handle_request(
user="drm", user="drm",
repo="deployer", repo="deployer",
branch="main", branch="main",
commit_hash=sys.argv[1],
) )
) )