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();