From 96295847cde694247949d887766d87af6ed9c3cf Mon Sep 17 00:00:00 2001 From: wandoubaba Date: Tue, 4 Jul 2023 13:49:23 +0800 Subject: [PATCH] start.php --- deploy/start.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/deploy/start.php b/deploy/start.php index 47c34e3..a4a7c78 100644 --- a/deploy/start.php +++ b/deploy/start.php @@ -15,21 +15,22 @@ $worker->onConnect = function ($connection) { echo "New connection\n"; }; -$worker->onMessage = function(TcpConnection $connection, Request $data) +$worker->onMessage = function(TcpConnection $connection, Request $request) { $work_dir = isset($_ENV['WORK_DIR']) ? $_ENV['WORK_DIR'] : null; $branch = isset($_ENV['BRANCH']) ? $_ENV['BRANCH'] : null; + var_dump($request->post()); if ($work_dir && $branch) { - chdir($work_dir); - exec("git fetch origin $branch"); - exec("git reset --hard FETCH_HEAD"); + // chdir($work_dir); + // exec("git fetch origin $branch"); + // exec("git reset --hard FETCH_HEAD"); - exec("yarn install"); - exec("yarn build"); + // exec("yarn install"); + // exec("yarn build"); - $connection->send("Deployment finished\n"); - $connection->close(); + // $connection->send("Deployment finished\n"); + // $connection->close(); } // 设置工作目录