From 145ba879bf539e285da116b8f9b19fb3f302d1fc Mon Sep 17 00:00:00 2001 From: wandoubaba Date: Tue, 4 Jul 2023 14:38:23 +0800 Subject: [PATCH] auto_build.sh --- auto_build.sh | 11 +++++++++++ deploy/start.php | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 auto_build.sh diff --git a/auto_build.sh b/auto_build.sh new file mode 100644 index 0000000..26d3476 --- /dev/null +++ b/auto_build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +GIT_WORK_TREE=/www/wwwroot/fs.book.wandoubaba.com + +cd $GIT_WORK_TREE + +git pull origin master + +yarn install + +yarn build \ No newline at end of file diff --git a/deploy/start.php b/deploy/start.php index c7149dc..127b4be 100644 --- a/deploy/start.php +++ b/deploy/start.php @@ -28,11 +28,11 @@ $worker->onMessage = function (TcpConnection $connection, Request $request) { $clone_url = isset($repository['clone_url']) ? $repository['clone_url'] : null; if ($git_url === $ssh_url || $git_url === $clone_url) { chdir($work_dir); - shell_exec("git fetch origin $branch"); - shell_exec("git reset --hard FETCH_HEAD"); + shell_exec("sh auto_build.sh"); + // shell_exec("git reset --hard FETCH_HEAD"); - shell_exec("yarn install"); - shell_exec("yarn build"); + // shell_exec("yarn install"); + // shell_exec("yarn build"); $connection->send("Deployment finished\n"); $connection->close();