2015-06-26 09:37:54 +01:00
|
|
|
<?php
|
2016-01-11 12:51:59 +07:00
|
|
|
/* (c) Anton Medvedev <anton@medv.io>
|
2015-06-26 09:37:54 +01:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2016-01-11 14:00:45 +07:00
|
|
|
namespace Deployer;
|
|
|
|
|
2015-06-26 09:37:54 +01:00
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
task('deploy:cache:clear', function () {
|
|
|
|
run("cd {{release_path}} && php -r \"require_once 'app/Mage.php'; umask(0); Mage::app()->cleanCache();\"");
|
|
|
|
})->desc('Clear cache');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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");
|
|
|
|
})->setPrivate();
|
|
|
|
|
|
|
|
after('deploy:update_code', 'deploy:clear_version');
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main task
|
|
|
|
*/
|
2016-04-04 17:01:55 +07:00
|
|
|
task('deploy', [
|
2015-06-26 09:37:54 +01:00
|
|
|
'deploy:prepare',
|
|
|
|
'deploy:release',
|
|
|
|
'deploy:update_code',
|
|
|
|
'deploy:shared',
|
|
|
|
'deploy:writable',
|
|
|
|
'deploy:cache:clear',
|
|
|
|
'deploy:symlink',
|
|
|
|
'cleanup',
|
|
|
|
])->desc('Deploy your project');
|
|
|
|
|
|
|
|
after('deploy', 'success');
|