deployer/recipe/laravel.php

55 lines
1.3 KiB
PHP
Raw Normal View History

2015-05-18 11:26:59 +07:00
<?php
2016-01-11 12:51:59 +07:00
/* (c) Anton Medvedev <anton@medv.io>
2015-05-18 11:26:59 +07: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-05-18 11:26:59 +07:00
require_once __DIR__ . '/common.php';
// This recipe support Laravel 5.1+, with orther version, please see document https://github.com/deployphp/docs
2015-05-18 11:26:59 +07:00
// 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
*/
taskGroup('deploy', [
2015-05-18 11:26:59 +07:00
'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('deploy:up', function () {
$output = run('php {{deploy_path}}/current/artisan up');
writeln('<info>'.$output.'</info>');
})->desc('Disable maintenance mode');
task('deploy:down', function () {
$output = run('php {{deploy_path}}/current/artisan down');
writeln('<error>'.$output.'</error>');
})->desc('Enable maintenance mode');