forked from re-connect/mpb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
52 lines (39 loc) · 1.14 KB
/
deploy.php
File metadata and controls
52 lines (39 loc) · 1.14 KB
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 'recipe/symfony.php';
// Config
set('repository', 'git@github.com:re-connect/mpb.git');
set('branch', 'main');
add('shared_files', [
'.env',
'.env.local',
'config/secrets/prod/prod.decrypt.private.php',
]);
add('shared_dirs', [
'var/log',
'var/oauth',
'node_modules',
'vendor',
'public/uploads',
]);
add('writable_dirs', []);
// Hosts
host('155.133.130.39')
->set('remote_user', 'www-data')
->set('deploy_path', '~/mpb');
// Tasks
task('deploy:build_frontend', function () {
run('cd {{release_path}} && npm run build');
});
task('deploy:install_frontend', function () {
run('cd {{release_path}} && npm install');
});
task('deploy:assets_install', function () {
run('cd {{release_path}} && php bin/console ckeditor:install --clear=drop --tag=4.22.1 && php bin/console assets:install public');
});
// Hooks
before('deploy:install_frontend', 'deploy:assets_install');
before('deploy:build_frontend', 'deploy:install_frontend');
before('deploy:cache:clear', 'deploy:build_frontend');
before('deploy:symlink', 'database:migrate');
after('deploy:failed', 'deploy:unlock');