-
Notifications
You must be signed in to change notification settings - Fork 12
/
deploy.php
61 lines (50 loc) · 1.54 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
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/php-fpm.php';
set('application', 'Leafapp');
set('repository', '[email protected]:iBotPeaches/LeafApp_Infinite.git');
set('php_fpm_service', 'ea-php82-php-fpm');
set('git_ssh_command', 'ssh -o StrictHostKeyChecking=no');
set('default_timeout', 1800);
host('prod')
->set('remote_user', 'leafapp')
->set('port', 22774)
->set('hostname', 'leafapp.co')
->set('deploy_path', '/home/leafapp/deploy');
task('deploy', [
'deploy:prepare',
'deploy:vendors',
'artisan:storage:link',
'artisan:view:cache',
'artisan:migrate',
'artisan:storage:link',
'npm:local:upload',
'artisan:horizon:assets',
'app:version:file',
'app:sentry:version',
'deploy:publish',
'artisan:optimize',
'php-fpm:reload',
'artisan:horizon:terminate',
]);
task('npm:local:upload', function () {
upload('public/build', '{{release_or_current_path}}/public');
});
task('app:version:file', function () {
upload('VERSION', '{{release_or_current_path}}/VERSION');
});
task('app:sentry:version', function () {
cd('{{release_or_current_path}}');
run("sed -i '/^SENTRY_LARAVEL_RELEASE/d' .env");
run('echo -e "SENTRY_LARAVEL_RELEASE=$(cat VERSION)" >> .env');
});
task('app:sitemap', function () {
cd('{{release_or_current_path}}');
run('php artisan sitemap:generate');
});
task('artisan:horizon:assets', function () {
cd('{{release_or_current_path}}');
run('php artisan horizon:publish');
});
after('deploy:failed', 'deploy:unlock');