-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sample.php
55 lines (43 loc) · 1.1 KB
/
deploy.sample.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
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/php-fpm.php';
require 'contrib/npm.php';
// Config
set('repository', '[email protected]:otim22/loan-management.git');
set('php_fpm_version', '8.1');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('prod')
->set('remote_user', 'root')
->set('identity_file', '~/.ssh/id_xxxxxxx')
->set('branch', 'main')
->set('hostname', 'xxx.xxx.xxx.xxx')
->set('deploy_path', '/var/www/loan_management');
// Hooks
task('prod', [
'deploy:prepare',
'deploy:vendors',
'artisan:storage:link',
'artisan:view:cache',
'artisan:config:clear',
'artisan:config:cache',
'artisan:migrate',
'composer:install',
'npm:install',
'artisan:optimize',
'npm:run:prod',
'deploy:publish',
'php-fpm:reload',
]);
task('composer:install', function () {
cd('{{release_or_current_path}}');
run('composer install');
});
task('npm:run:prod', function () {
cd('{{release_or_current_path}}');
run('npm run prod');
});
after('deploy:failed', 'deploy:unlock');