-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.php
49 lines (38 loc) · 1.33 KB
/
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
41
42
43
44
45
46
47
48
49
<?php
namespace Deployer;
require 'recipe/common.php';
require 'recipe/laravel.php';
require 'contrib/crontab.php';
// Config
set('git_tty', true);
set('git_ssh_command', 'ssh'); // Fix unsupported option "accept-new" (OpenSSH version older than v7.6)
set('repository', '[email protected]:mgkprod/magenta-database');
add('crontab:jobs', ['* * * * * cd {{current_path}} && {{bin/php}} artisan schedule:run >> /dev/null 2>&1']);
// Hosts
host('o2switch/magenta-database')
->set('remote_user', 'mgkprod')
->set('deploy_path', '~/magenta-database.mgk.dev')
->set('http_user', 'mgkprod')
->set('writable_mode', 'chown')
->set('crontab:identifier', 'magenta-database')
->setLabels(['env' => 'production']);
host('o2switch/distractions-database')
->set('remote_user', 'mgkprod')
->set('deploy_path', '~/distractions-database.mgk.dev')
->set('http_user', 'mgkprod')
->set('writable_mode', 'chown')
->set('crontab:identifier', 'distractions-database')
->setLabels(['env' => 'production']);
// Hooks
task('npm:ci', function () {
cd('{{release_path}}');
run('npm ci');
});
task('npm:build', function () {
cd('{{release_path}}');
run('npm run build');
});
after('deploy:vendors', 'npm:ci');
after('npm:ci', 'npm:build');
after('deploy:failed', 'deploy:unlock');
after('deploy:success', 'crontab:sync');