deployer/recipe/magento.php

51 lines
1.1 KiB
PHP
Raw Normal View History

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 () {
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 () {
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');
task('deploy', [
'deploy:prepare',
2015-06-26 09:37:54 +01:00
'deploy:cache:clear',
'deploy:publish',
2020-10-29 23:16:36 +01:00
]);