1 | <?php |
||
2 | namespace Deployer; |
||
3 | |||
4 | require_once __DIR__ . '/symfony3.php'; |
||
5 | |||
6 | add('shared_dirs', ['var/indexes', 'var/sitemaps', 'var/uploads', 'web/uploads']); |
||
7 | |||
8 | add('writable_dirs', ['var/indexes', 'var/sitemaps', 'var/uploads', 'web/uploads']); |
||
9 | |||
10 | set('bin/websiteconsole', function () { |
||
11 | return parse('{{bin/php}} {{release_path}}/bin/websiteconsole --no-interaction'); |
||
12 | }); |
||
13 | |||
14 | desc('Migrate PHPCR'); |
||
15 | task( |
||
16 | 'phpcr:migrate', |
||
17 | function () { |
||
18 | run('{{bin/php}} {{bin/console}} phpcr:migrations:migrate {{console_options}}'); |
||
19 | } |
||
20 | ); |
||
21 | |||
22 | desc('Clear cache'); |
||
23 | task('deploy:website:cache:clear', function () { |
||
24 | run('{{bin/websiteconsole}} cache:clear {{console_options}} --no-warmup'); |
||
25 | }); |
||
26 | |||
27 | desc('Warm up cache'); |
||
28 | task('deploy:website:cache:warmup', function () { |
||
29 | run('{{bin/websiteconsole}} cache:warmup {{console_options}}'); |
||
30 | }); |
||
31 | |||
32 | after('deploy:cache:clear', 'deploy:website:cache:clear'); |
||
33 | after('deploy:website:cache:clear', 'deploy:website:cache:warmup'); |
||
34 |