Skip to content

Instantly share code, notes, and snippets.

@moon0326
Last active April 27, 2016 11:17
Show Gist options
  • Save moon0326/352404802a4a37517771 to your computer and use it in GitHub Desktop.
Save moon0326/352404802a4a37517771 to your computer and use it in GitHub Desktop.
PHP Deployer Laravel sample
<?php
require_once 'recipe/common.php';
server('production', 'server ip', 'port (optional)')
->user('deploy')
->path('Path');
set('shared_dirs',['app/storage']);
set('shared_files',[]);
set('repository', 'git url');
set('writeable_dirs', ['app/storage']);
task('database:migrate', function() {
run("php current/artisan migrate");
});
task('laravel:create_storage_dirs', function() {
run("mkdir current/app/storage/sessions");
run("mkdir current/app/storage/views");
run("mkdir current/app/storage/meta");
run("mkdir current/app/storage/logs");
run("mkdir current/app/storage/cache");
});
task('deploy', [
'deploy:start',
'deploy:prepare',
'deploy:update_code',
'deploy:shared',
'deploy:writeable_dirs',
'laravel:create_storage_dirs',
'deploy:vendors',
'deploy:symlink',
'database:migrate',
'cleanup',
'deploy:end'
])->desc('Deploy your project');
@drakakisgeo
Copy link

Trying to figure this out. Migrations and composer install/update should be optional and also in rollback you should rollback all those too ( migrations / composer ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment