-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.php
54 lines (38 loc) · 1.12 KB
/
deploy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
// set('repository', '[email protected]:superwen/SmartVoiceAdmin.git');
set('repository', 'https://gitee.com/subowen/SmartVoiceAdmin.git');
set('git_tty', true);
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
set('allow_anonymous_stats', false);
set('default_stage', 'local');
// Hosts
host('120.27.239.106')
->port('56413')
->user('chenshengwen')
->stage('prod')
->set('deploy_path', '/hwdata/www/SmartVoiceAdmin');
localhost()
->stage('local')
->roles('test', 'build');
desc('git push origin master');
task('git:push', function() {
writeln('start git push task');
$result = run('pwd');
writeln("Current dir: $result");
run('git add .');
run('git commit -m "auto commit by deploy"');
run('git push origin master');
});
// Tasks
desc('Restart PHP-FPM service');
task('php-fpm:restart', function () {
run('sudo systemctl restart php-fpm.service');
});
after('deploy:symlink', 'php-fpm:restart');
after('deploy:failed', 'deploy:unlock');
//before('deploy:symlink', 'artisan:migrate');