Closed iamphilrae closed 5 years ago
From a previous Lumen issue I found here (https://github.com/deployphp/deployer/issues/1534), I think I have a potential "fix"(?). I've amended my deploy.php file to include the following, which I pulled out of the Laravel Recipe. Note the lines I have commented out which were failing for Lumen:
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:writable',
// 'artisan:storage:link',
// 'artisan:view:clear',
// 'artisan:config:cache',
'artisan:optimize',
'deploy:symlink',
'deploy:unlock',
'cleanup',
]);
Could someone well versed in this project please let me know if this is the appropriate thing to do? If so, it would be great for the sake of keeping the deploy.php file to a minimum, to have the Laravel Recipe updated to test for the lack of these artisan processes in Lumen, and therefore not attempt to run them.
Full deploy.php
file for reference:
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Project name
set('application', 'xxxxxxxxxxxxx');
// Project repository
set('repository', 'git@bitbucket.org:xxxxxxxxx/xxxxxxxxx.git');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
add('shared_files', []);
add('shared_dirs', []);
// Writable dirs by web server
add('writable_dirs', []);
// Hosts
host('xxxxxxxxx@xxxxxxxxxx.com')
->stage('production')
->set('deploy_path', '/var/www/service1');
// Tasks
task('build', function () {
run('cd {{release_path}} && build');
});
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:writable',
// 'artisan:storage:link',
// 'artisan:view:clear',
// 'artisan:config:cache',
'artisan:optimize',
'deploy:symlink',
'deploy:unlock',
'cleanup',
]);
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Migrate database before symlink new release.
before('deploy:symlink', 'artisan:migrate');
@iamphilrae Hi Phil! As you can see here https://github.com/deployphp/deployer/tree/master/recipe, unfortunately, there is no recipe for Lumen. This means that you could a) take basic common.php
and customize with your steps (which you can grab from laravel recipe, for example), b) take laravel recipe and customize it, but be aware that it could be changed in the future along with new major laravel release, c) create new recipe and push it as Pull Request. You can see, that any framework specific recipe is a common.php
with additional steps. So, you could override steps, use them or not. It doesn't bring any overhead.
To summarize: I think that in your case, overriding Laravel main deploy
task is okay.
Thanks @pluseg. I was under the impression from this repo's past history that the Laraval recipe was intended to be compatible with Lumen as well (out the box). I've managed to get it to run, however my Laravel/Lumen knowledge is very limited so I wouldn't be confident in posting a PR. My answer above is 'working' though so the history is there for anyone looking in the future.
Thanks
Description
Attempting to deploy a Lumen project to an Ubuntu AWS EC2 server. The process begins however halts mid-way with this error logged by Lumen.
Steps to reproduce
Content of
deploy.php
Output log