-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdeploy.php
41 lines (32 loc) · 804 Bytes
/
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
<?php
namespace Deployer;
require 'recipe/laravel.php';
set('default_stage', 'production');
set('keep_releases', 5); // Max releases
// Project repository
set('repository', '[email protected]:visavi/rotor.git');
add('shared_files', []);
add('shared_dirs', [
'public/uploads',
'public/assets/modules',
]);
add('writable_dirs', [
'public/uploads/*',
'public/assets/modules',
]);
set('bin/npm', function () {
return which('npm');
});
// Hosts
host('production')
->setHostname('hostname')
->set('remote_user', 'www-data')
->set('deploy_path', '/var/www/rotor');
// Tasks
task('build', function () {
cd('{{release_path}}');
run('{{bin/npm}} ci');
run('{{bin/npm}} run prod');
});
after('deploy:update_code', 'build');
after('deploy:failed', 'deploy:unlock');