-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy.php
61 lines (46 loc) · 1.41 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
declare(strict_types=1);
namespace Deployer;
require 'recipe/common.php';
set('application', 'autonode');
set('repository', 'git@github.com:1ma/autonode');
set('keep_releases', 5);
host('autonode.1mahq.com')
->setRemoteUser('deployer')
->setDeployPath('/var/www/{{application}}')
->setSshArguments([
'-o StrictHostKeyChecking=accept-new',
]);
task('autonode:build', static function () {
runLocally('composer install --no-dev --classmap-authoritative');
});
task('autonode:upload', static function () {
upload(__DIR__.'/composer.json', '{{release_path}}');
upload(__DIR__.'/composer.lock', '{{release_path}}');
upload(__DIR__.'/resources', '{{release_path}}');
upload(__DIR__.'/src', '{{release_path}}');
upload(__DIR__.'/vendor', '{{release_path}}');
upload(__DIR__.'/web', '{{release_path}}');
});
task('autonode:check-reqs', static function () {
run('composer --working-dir=/var/www/autonode/release check-platform-reqs --no-dev');
});
task('autonode:bust-opcache', static function () {
run('cachetool opcache:reset');
});
task('autonode:deploy', [
'autonode:build',
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'deploy:shared',
'deploy:writable',
'autonode:upload',
'autonode:check-reqs',
'deploy:symlink',
'deploy:unlock',
'autonode:bust-opcache',
'deploy:cleanup',
'deploy:success',
]);