env
This commit is contained in:
parent
2e98a15071
commit
93f0e66c93
@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# GIT_WORK_TREE=/www/wwwroot/fs.book.wandoubaba.com
|
||||
|
||||
# cd $GIT_WORK_TREE
|
||||
|
||||
git pull origin master
|
||||
|
||||
yarn install
|
||||
|
@ -17,9 +17,10 @@ $worker->onConnect = function ($connection) {
|
||||
};
|
||||
|
||||
$worker->onMessage = function (TcpConnection $connection, Request $request) {
|
||||
$work_dir = '/www/wwwroot/fs.book.wandoubaba.com';
|
||||
$branch = 'master';
|
||||
$git_url = 'git@git.wandoubaba.com:wandoubaba/knowledge.git';
|
||||
$work_dir = isset($_ENV['WORK_DIR']) ? $_ENV['WORK_DIR'] : null;
|
||||
$branch = isset($_ENV['BRANCH']) ? $_ENV['BRANCH'] : null;
|
||||
$git_url = isset($_ENV['GIT_URL']) ? $_ENV['GIT_URL'] : null;
|
||||
if ($work_dir && $branch && $git_url) {
|
||||
$repository = $request->post('repository');
|
||||
if (is_array($repository)) {
|
||||
$ssh_url = isset($repository['ssh_url']) ? $repository['ssh_url'] : null;
|
||||
@ -31,6 +32,7 @@ $worker->onMessage = function (TcpConnection $connection, Request $request) {
|
||||
$connection->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 运行worker
|
||||
|
Loading…
Reference in New Issue
Block a user