This repository has been archived by the owner on Jun 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 164
/
deploy.php
69 lines (57 loc) · 1.55 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'yikeio client');
// Project repository
set('repository', 'git@github.com:overtrue/yike.io.git');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('default_timeout', 1600);
set('deploy_path', '/www/yike.io');
set('writable_use_sudo', true);
set('clear_use_sudo', true);
set('cleanup_use_sudo', true);
set('http_group', 'www-data');
set('writable_mode', 'chown');
set('default_stage', 'production');
set('keep_releases', 2);
set('shared_files', [
'.env.production',
]);
host('yike.io')
->stage('production')
->user('deployer')
->multiplexing(true);
desc('Run build.');
task('npm:install-and-compile', function(){
// if (has('previous_release')) {
// run('cp -R {{previous_release}}/node_modules {{release_path}}/node_modules');
// }
within('{{release_path}}', function () {
// run('npm install --registry=http://registry.npm.taobao.org ');
run('npm install');
run('npm run build');
});
});
// Tasks
desc('Deploy your project');
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'npm:install-and-compile',
'deploy:writable',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success'
]);
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');