-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
40 lines (27 loc) · 927 Bytes
/
deploy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', '[email protected]:sysatom/develophub.git');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Servers
server('production', '45.248.87.150')
->user('deploy')
->password(null)
->set('deploy_path', '/home/deploy/devhub.io');
// 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');