deployer/recipe/laravel.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2015-05-18 11:26:59 +07:00
<?php
/* (c) Anton Medvedev <anton@elfet.ru>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once __DIR__ . '/common.php';
// Laravel shared dirs
2015-09-09 10:58:37 +03:00
set('shared_dirs', [
'storage/app',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
2015-09-09 16:32:10 +03:00
'storage/logs',
2015-09-09 10:58:37 +03:00
]);
2015-05-18 11:26:59 +07:00
// Laravel 5 shared file
set('shared_files', ['.env']);
2015-05-18 11:26:59 +07:00
// Laravel writable dirs
set('writable_dirs', ['bootstrap/cache', 'storage']);
2015-05-18 11:26:59 +07:00
/**
* Main task
*/
task('deploy', [
'deploy:prepare',
'deploy:release',
'deploy:update_code',
'deploy:vendors',
'deploy:shared',
2015-05-18 11:26:59 +07:00
'deploy:symlink',
'cleanup',
])->desc('Deploy your project');
after('deploy', 'success');
/**
* Helper tasks
*/
task('up', function () {
$output = run('php {{deploy_path}}/current/artisan up');
writeln('<info>'.$output.'</info>');
})->desc('Disable maintenance mode');
task('down', function () {
$output = run('php {{deploy_path}}/current/artisan down');
writeln('<error>'.$output.'</error>');
})->desc('Enable maintenance mode');