-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.php
79 lines (62 loc) · 1.68 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
70
71
72
73
74
75
76
77
78
79
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'dinoremix');
// Project repository
set('repository', '[email protected]:aag/dinoremix.git');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
set('shared_files', [
'data/AlreadyDownloaded.txt',
'data/GuestComicsURLs.txt',
]);
set('shared_dirs', [
'data/comics',
'data/filelists',
'public/panels',
]);
// Speed up the native ssh client
set('ssh_multiplexing', true);
// Keep 4 total versions for rollbacks
set('keep_releases', 4);
// Hosts
host('dinoremix.definingterms.com')
->user('deployer')
->forwardAgent(true)
->stage('production')
->set('deploy_path', '/var/www/dinoremix.definingterms.com');
// Tasks
task('deploy:npm_install', function () {
cd('{{release_path}}');
$output = run('npm install');
})->desc('Install npm modules');
task('deploy:npm_build', function () {
cd('{{release_path}}');
$output = run('npm run build');
})->desc('Build frontend assets');
task('deploy:fpm_restart', function () {
$output = run('sudo service php7.3-fpm restart');
})->desc('Restart PHP-FPM');
desc('Deploy Dinosaur Remix');
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:npm_install',
'deploy:npm_build',
'deploy:clear_paths',
'deploy:symlink',
'deploy:fpm_restart',
'deploy:unlock',
'cleanup',
'success'
]);
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');