-
Notifications
You must be signed in to change notification settings - Fork 3
/
deploy.php
51 lines (43 loc) · 1.13 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
<?php
namespace Deployer;
require 'recipe/composer.php';
// Configuration
set('ssh_type', 'native');
set('repository', 'git@bitbucket.org:ayctor/cwpt.git');
set('shared_files', [
'.env',
]);
set('shared_dirs', [
'mu-plugins',
]);
set('writable_dirs', []);
// Servers
host('forge@qa.ayctor.io')
->stage('test')
->set('deploy_path', '/home/forge/deploy/');
// Tasks
set('bin/npm', function () {
return run('which npm');
});
desc('Install npm packages');
task('npm:install', function () {
run("cd {{release_path}} && {{bin/npm}} ci --no-audit");
});
after('deploy:update_code', 'npm:install');
desc('Build assets');
task('npm:build', function () {
run("cd {{release_path}} && {{bin/npm}} run production");
});
after('npm:install', 'npm:build');
desc('Reload PHP');
task('php:reload', function(){
run('sudo /usr/sbin/service php7.2-fpm reload');
})->onStage('test');
after('deploy:symlink', 'php:reload');
// set('bin/wp', function () {
// return run('which wp');
// });
// task('reset:opcache', function () {
// run('cd {{release_path}} && {{bin/wp}} reset opcache');
// });
// after('deploy', 'reset:opcache');