Put this task in the .mage/tasks/
directory :
namespace Task;
use Mage\Task\AbstractTask;
class Chmod extends AbstractTask
{
public function getName()
{
return 'Fixing file permissions';
}
public function run()
{
// Options
$mode = $this->getParameter('mode', '755');
$recursive = $this->getParameter('recursive', true);
$targets = $this->getParameter('targets', array('.'));
$options = ($recursive) ? ' -R ' : '';
$command = 'chmod '. $options . $mode . ' ' . implode(' ', $targets);
$result = $this->runCommandRemote($command);
return $result;
}
}
usage :
tasks:
post-deploy:
- chmod: { mode: "777", targets: ["log/single-log-file.log"], recursive: false }
- chmod: { mode: "777", targets: ["cache/", "log/"] }