Skip to content

Instantly share code, notes, and snippets.

@chrisblackwell
Created April 4, 2017 18:25
Show Gist options
  • Save chrisblackwell/09d8309f89649f0e61d2ee41ba40006a to your computer and use it in GitHub Desktop.
Save chrisblackwell/09d8309f89649f0e61d2ee41ba40006a to your computer and use it in GitHub Desktop.
Laravel Deployer settings
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('repository', '-- put Git Repo URL here --');
set('ssh_type', 'native');
set('shared_files', ['.env']);
set('shared_dirs', [
'storage/app',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
'storage/logs',
]);
set('writable_dirs', ['bootstrap/cache', 'storage']);
set('writable_use_sudo', false);
// Servers
server('production', 'app.domain.tld')
->user('deploy')
->identityFile()
->branch('master')
->set('deploy_path', '/srv/www/app.domain.tld');
server('staging', 'staging.app.domain.tld')
->user('deploy')
->identityFile()
->branch('develop')
->set('deploy_path', '/srv/www/staging.app.domain.tld');
// Tasks
desc('Restart PHP-FPM service');
task('php-fpm:restart', function () {
run('sudo service php7.1-fpm reload');
});
after('deploy:symlink', 'php-fpm:restart');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment