6
0
Fork 0

更新发布脚本

release
李静 2022-01-05 13:30:26 +08:00
parent d2eb0f422a
commit 6528a20c41
1 changed files with 22 additions and 2 deletions

View File

@ -35,11 +35,31 @@ host('test.zichunsheng.cn')
->set('branch', 'develop')
->set('deploy_path', '/www/wwwroot/test.zichunsheng.cn');
// 生产环境
host('47.108.202.152', '47.108.227.246')
->user('deployer')
->port(22)
->identityFile('~/.ssh/deployer_rsa')
->forwardAgent(true)
->multiplexing(true)
->addSshOption('UserKnownHostsFile', '/dev/null')
->addSshOption('StrictHostKeyChecking', 'no')
->stage('production')
->set('branch', 'master')
->set('deploy_path', '/www/wwwroot/api.zichunsheng.cn');
// Tasks
// [Optional] if deploy fails automatically unlock.
// 如果发布失败,自动解锁
after('deploy:failed', 'deploy:unlock');
// 发布完成后重启 PHP-FPM
after('success', 'php:restart');
// Migrate database before symlink new release.
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)');
});