42 lines
999 B
PHP
42 lines
999 B
PHP
<?php
|
|
namespace Deployer;
|
|
require 'recipe/laravel.php';
|
|
|
|
// Configuration
|
|
|
|
set('ssh_type', 'native');
|
|
set('ssh_multiplexing', true);
|
|
|
|
set('repository', 'git@git.nabble.co.uk:mshillam/mdbpanel.git');
|
|
|
|
add('shared_files', []);
|
|
add('shared_dirs', []);
|
|
|
|
add('writable_dirs', []);
|
|
|
|
// Servers
|
|
|
|
host('production', '192.168.20.2')
|
|
->user('mydentalbackup')
|
|
->identityFile('~/.ssh/id_mshillam.pub')
|
|
->set('deploy_path', 'domains/panel.mydentalbackup.co.uk/public_html')
|
|
->pty(true);
|
|
|
|
|
|
// Tasks
|
|
|
|
desc('Restart PHP-FPM service');
|
|
task('php-fpm:restart', function () {
|
|
// The user must have rights for restart service
|
|
// /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
|
|
// run('sudo systemctl restart php-fpm.service');
|
|
});
|
|
after('deploy:symlink', 'php-fpm:restart');
|
|
|
|
// [Optional] if deploy fails automatically unlock.
|
|
after('deploy:failed', 'deploy:unlock');
|
|
|
|
// Migrate database before symlink new release.
|
|
|
|
before('deploy:symlink', 'artisan:migrate');
|