From 6067fe5e9e6ed8a993341ac4fe617a47752443b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Fri, 7 Jan 2022 12:25:45 +0800 Subject: [PATCH] Update deploy.php --- deploy.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/deploy.php b/deploy.php index 72d738f5..5ddbf504 100644 --- a/deploy.php +++ b/deploy.php @@ -37,7 +37,9 @@ host('test.zichunsheng.cn') // 生产环境 -host('47.108.202.152', '47.108.227.246') + +host('production') + ->hostname('47.108.202.152') ->user('deployer') ->port(22) ->identityFile('~/.ssh/deployer_rsa') @@ -49,6 +51,18 @@ host('47.108.202.152', '47.108.227.246') ->set('branch', 'master') ->set('deploy_path', '/www/wwwroot/api.zichunsheng.cn'); +host('admin') + ->hostname('47.108.202.152') + ->user('deployer') + ->port(22) + ->identityFile('~/.ssh/deployer_rsa') + ->forwardAgent(true) + ->multiplexing(true) + ->addSshOption('UserKnownHostsFile', '/dev/null') + ->addSshOption('StrictHostKeyChecking', 'no') + ->stage('admin') + ->set('branch', 'master') + ->set('deploy_path', '/www/wwwroot/admin.zichunsheng.cn'); // Tasks // 如果发布失败,自动解锁 @@ -61,5 +75,5 @@ before('deploy:symlink', 'artisan:migrate'); desc('重启 PHP-FPM 进程'); task('php:restart', function () { - run('sudo kill -USR2 $(cat /www/server/php/80/var/run/php-fpm.pid)'); -}); + run('sudo systemctl restart php8.0-fpm.service'); +})->onStage(['production', 'admin']);