auto_build.sh

This commit is contained in:
wandoubaba 2023-07-04 14:38:23 +08:00
parent 315d7f9193
commit 145ba879bf
2 changed files with 15 additions and 4 deletions

11
auto_build.sh Normal file
View File

@ -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

View File

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