-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdeploy.php
52 lines (44 loc) · 1.3 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
<?php
namespace Deployer;
require './vendor/deployer/deployer/recipe/laravel.php';
import('hosts.yaml');
// Configuration
set('default_stage', 'production');
set('application', 'BooksBank');
set('repository', 'https://github.com/Zelig880/BookSwap.git');
set('http_user', 'booksban');
set('writable_mode', 'chmod');
set('keep_releases', 2);
set('deploy_path', __DIR__ . '/.build');
task('node', function() {
invoke('copy:node_modules');
invoke('install:node_modules');
invoke('backup:node_modules');
} )->once();
task('upload:node', function () {
upload(__DIR__ . "/public", '{{release_path}}');
});
task('copy:node_modules', function () {
run('cd {{release_path}}/.. && mv node_modules {{release_path}}');
});
task('install:node_modules', function () {
runLocally('cd ' . __DIR__ . ' && yarn install');
runLocally('cd ' . __DIR__ . ' && yarn production');
});
task('backup:node_modules', function () {
run('cd {{release_path}} && mv node_modules ../');
});
task('deploy:live', [
'deploy:prepare',
'deploy:vendors',
'install:node_modules',
'upload:node',
'artisan:storage:link',
'artisan:config:cache',
'artisan:route:cache',
'artisan:view:cache',
'artisan:event:cache',
'artisan:migrate',
'deploy:publish'
]);
after('deploy:failed', 'deploy:unlock');