forked from deployphp/deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
magento.php
50 lines (39 loc) · 1.02 KB
/
magento.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
<?php
namespace Deployer;
require_once __DIR__ . '/common.php';
add('recipes', ['magento']);
/**
* Magento Configuration
*/
// Magento shared dirs
set('shared_dirs', ['var', 'media']);
// Magento shared files
set('shared_files', ['app/etc/local.xml']);
// Magento writable dirs
set('writable_dirs', ['var', 'media']);
/**
* Clear cache
*/
desc('Clear cache');
task('deploy:cache:clear', function () {
run("cd {{release_path}} && php -r \"require_once 'app/Mage.php'; umask(0); Mage::app()->cleanCache();\"");
});
/**
* Remove files that can be used to compromise Magento
*/
task('deploy:clear_version', function () {
run("rm -f {{release_path}}/LICENSE.html");
run("rm -f {{release_path}}/LICENSE.txt");
run("rm -f {{release_path}}/LICENSE_AFL.txt");
run("rm -f {{release_path}}/RELEASE_NOTES.txt");
})->hidden();
after('deploy:update_code', 'deploy:clear_version');
/**
* Main task
*/
desc('Deploy your project');
task('deploy', [
'deploy:prepare',
'deploy:cache:clear',
'deploy:publish',
]);