Last active
April 27, 2016 11:17
-
-
Save moon0326/352404802a4a37517771 to your computer and use it in GitHub Desktop.
PHP Deployer Laravel sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ).