6
0
Fork 0

Update deploy.php

release
李静 2022-01-07 12:25:45 +08:00
parent 7cd7530d46
commit 6067fe5e9e
1 changed files with 17 additions and 3 deletions

View File

@ -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']);