2015-06-26 09:37:54 +01:00
|
|
|
<?php
|
2016-01-11 14:00:45 +07:00
|
|
|
namespace Deployer;
|
|
|
|
|
2015-06-26 09:37:54 +01:00
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
|
2020-10-25 16:00:05 +01:00
|
|
|
add('recipes', ['magento']);
|
|
|
|
|
2015-06-26 09:37:54 +01:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2021-11-08 22:59:39 +01:00
|
|
|
desc('Clears cache');
|
2015-06-26 09:37:54 +01:00
|
|
|
task('deploy:cache:clear', function () {
|
2021-04-03 13:05:45 +01:00
|
|
|
run("cd {{release_or_current_path}} && php -r \"require_once 'app/Mage.php'; umask(0); Mage::app()->cleanCache();\"");
|
2020-10-29 23:16:36 +01:00
|
|
|
});
|
2015-06-26 09:37:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove files that can be used to compromise Magento
|
|
|
|
*/
|
|
|
|
task('deploy:clear_version', function () {
|
2021-04-03 13:05:45 +01:00
|
|
|
run("rm -f {{release_or_current_path}}/LICENSE.html");
|
|
|
|
run("rm -f {{release_or_current_path}}/LICENSE.txt");
|
|
|
|
run("rm -f {{release_or_current_path}}/LICENSE_AFL.txt");
|
|
|
|
run("rm -f {{release_or_current_path}}/RELEASE_NOTES.txt");
|
2020-04-25 23:00:08 +03:00
|
|
|
})->hidden();
|
2015-06-26 09:37:54 +01:00
|
|
|
|
|
|
|
after('deploy:update_code', 'deploy:clear_version');
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main task
|
|
|
|
*/
|
2021-11-08 22:59:39 +01:00
|
|
|
desc('Deploys your project');
|
2016-04-04 17:01:55 +07:00
|
|
|
task('deploy', [
|
2020-10-08 01:53:45 +02:00
|
|
|
'deploy:prepare',
|
2015-06-26 09:37:54 +01:00
|
|
|
'deploy:cache:clear',
|
2020-10-08 01:53:45 +02:00
|
|
|
'deploy:publish',
|
2020-10-29 23:16:36 +01:00
|
|
|
]);
|