-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.php
79 lines (69 loc) · 1.85 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
/** @noinspection ALL */
namespace Deployer;
require 'recipe/symfony.php';
set('repository', 'https://github.com/ivanstan/tle-api');
set('git_tty', true);
set('bin_dir', 'bin');
set('http_user', 'glutenfr');
set('writable_mode', 'chmod');
set('default_stage', 'production');
set('bin/composer', '~/bin/composer.phar');
set('composer_options', '{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader');
add('shared_files', [
'.env',
'public/robots.txt',
'public/manifest.json',
'public/asset-manifest.json',
'public/favicon.ico',
'public/index.html',
'public/logo192.png',
'public/logo512.png',
]);
add('shared_dirs', [
'public/static',
'public/images',
]);
add('writable_dirs', ['var']);
host('tle.ivanstanojevic.me')
->user('glutenfr')
->port(2233)
->stage('production')
->set('deploy_path', '~/projects/tle.ivanstanojevic.me');
task('test', function () {
// set('symfony_env', 'test');
// runLocally('bin/phpunit');
// set('symfony_env', 'dev');
});
task('deploy:dump-env', function () {
run('cd {{release_path}} && {{bin/composer}} dump-env prod');
});
task('deploy:executable', function () {
run('chmod +x {{release_path}}/bin/console');
});
task(
'deploy',
[
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:clear_paths',
'deploy:create_cache_dir',
'deploy:shared',
'deploy:assets',
'deploy:writable',
'deploy:vendors',
'deploy:executable',
'deploy:cache:clear',
'deploy:cache:warmup',
'deploy:dump-env',
'database:migrate',
'deploy:symlink',
'deploy:unlock',
'cleanup',
]
);
before('deploy', 'test');
after('deploy:failed', 'deploy:unlock');