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';
|
2016-01-08 08:41:16 +07:00
|
|
|
// 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
|
|
|
|
2015-05-28 00:41:52 +07:00
|
|
|
// Laravel 5 shared file
|
|
|
|
set('shared_files', ['.env']);
|
|
|
|
|
2015-05-18 11:26:59 +07:00
|
|
|
// Laravel writable dirs
|
2016-01-04 22:56:26 +01:00
|
|
|
set('writable_dirs', ['bootstrap/cache', 'storage']);
|
2015-05-18 11:26:59 +07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Main task
|
|
|
|
*/
|
2016-02-16 09:47:26 +07:00
|
|
|
taskGroup('deploy', [
|
2015-05-18 11:26:59 +07:00
|
|
|
'deploy:prepare',
|
|
|
|
'deploy:release',
|
|
|
|
'deploy:update_code',
|
|
|
|
'deploy:vendors',
|
2015-05-20 22:39:24 +03:00
|
|
|
'deploy:shared',
|
2015-05-18 11:26:59 +07:00
|
|
|
'deploy:symlink',
|
|
|
|
'cleanup',
|
|
|
|
])->desc('Deploy your project');
|
|
|
|
|
|
|
|
after('deploy', 'success');
|
2016-01-07 17:31:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper tasks
|
|
|
|
*/
|
2016-01-08 08:41:16 +07:00
|
|
|
task('deploy:up', function () {
|
2016-01-07 17:31:27 +01:00
|
|
|
$output = run('php {{deploy_path}}/current/artisan up');
|
|
|
|
writeln('<info>'.$output.'</info>');
|
|
|
|
})->desc('Disable maintenance mode');
|
|
|
|
|
2016-01-08 08:41:16 +07:00
|
|
|
task('deploy:down', function () {
|
2016-01-07 17:31:27 +01:00
|
|
|
$output = run('php {{deploy_path}}/current/artisan down');
|
|
|
|
writeln('<error>'.$output.'</error>');
|
|
|
|
})->desc('Enable maintenance mode');
|