-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsymfony.php
More file actions
94 lines (73 loc) · 2.63 KB
/
symfony.php
File metadata and controls
94 lines (73 loc) · 2.63 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
namespace Deployer;
/**
* @author Benjamin HUBERT <benjamin@alpixel.fr>
*/
require 'recipe/symfony3.php';
require __DIR__ . '/common.php';
set('php_fpm', 'php5-fpm');
set('npm', function () {
return run("which npm")->toString();
});
set('bower', function () {
return run("which bower")->toString();
});
set('gulp', function () {
return run("which gulp")->toString();
});
set('shared_dirs', array_merge(get('shared_dirs'), [
'var/prod/logs',
'var/sessions',
'web/lib',
'web/upload',
'web/system',
'node_modules',
]));
set('shared_files', array_merge(get('shared_files'), [
'sitemap.xml'
]));
task('dump:parameters', function () {
run('cat {{deploy_path}}/current/' . trim(get('bin_dir'), '/') . '/../app/config/parameters.yml');
});
task('deploy:writable', function () {
});
task('deploy:assets', function () {
})->desc('Normalize asset timestamps');
task('deploy:assetic:dump', function () {
run("cd {{release_path}} && {{npm}} install");
run("cd {{release_path}} && {{bower}} install");
run("cd {{release_path}} && {{gulp}}");
})->desc('Dump assets');
task('deploy:cron:enable', function () {
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console cron:scan --env=\'prod\'');
});
after('deploy:symlink', 'deploy:cron:enable');
task('deploy:database:update', function () {
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console doctrine:schema:update --env={{env}} --force');
});
after('deploy:vendors', 'deploy:database:update');
task('elastica:populate', function () {
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console fos:elastica:populate --env=\'prod\'');
});
task('php:restart', function () {
run('sudo service {{php_fpm}} restart');
});
after('deploy', 'php:restart');
task('elastica:populate', function () {
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console fos:elastica:populate --env=\'prod\'');
});
task('elastica:populate:current', function () {
run('php {{deploy_path}}/current/' . trim(get('bin_dir'), '/') . '/console fos:elastica:populate --env=\'prod\'');
});
task('seo:dump', function () {
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console seo:metatag:patterns --env=\'prod\'');
run('php {{release_path}}/' . trim(get('bin_dir'), '/') . '/console seo:sitemap --env=\'prod\'');
});
task('deploy:cleanup', function() {
run('rm -f {{release_path}}/Vagrantfile*');
run('rm -f {{release_path}}/deploy.php');
run('rm -rf {{release_path}}/.git');
run('rm -f {{release_path}}/README*');
run('rm -f {{release_path}}/build.xml');
});
after('cleanup', 'deploy:cleanup');