-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.php
70 lines (48 loc) · 1.83 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace Deployer;
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
# https://github.com/deployphp/deployer/blob/master/recipe/laravel.php
require 'recipe/laravel.php';
require 'recipe/sentry.php';
require 'recipe/slack.php';
task('npm:install', 'npm install');
task('npm:build', 'npm run production');
task('bibrex:version-notify', 'php artisan bibrex:version-notify');
# 2020-11-07 Disable until https://github.com/beyondcode/laravel-self-diagnosis/pull/102 is merged
# task('self-diagnosis', 'php artisan self-diagnosis');
// Hosts
inventory('hosts.yml');
// Project name
set('application', 'bibrex');
// Number of releases to keep
set('keep_releases', 3);
set('ssh_multiplexing', true);
// Project repository
set('repository', 'https://github.com/scriptotek/bibrex.git');
set('slack_webhook', $_ENV['SLACK_HOOK']);
set('sentry', [
'organization' => 'uio-realfagsbiblioteket',
'project' => 'bibrex',
'token' => $_ENV['SENTRY_TOKEN'],
// 'version' => '1.0.0'
]);
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
set('http_user', 'nginx');
// Shared files/dirs between deploys
add('shared_dirs', ['storage']);
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
after('deploy:vendors', 'npm:install');
after('npm:install', 'npm:build');
before('deploy:symlink', 'artisan:migrate');
before('deploy:symlink', 'artisan:route:cache');
after('deploy:symlink', 'artisan:queue:restart');
# after('deploy:symlink', 'self-diagnosis');
after('deploy:failed', 'slack:notify:failure');
after('success', 'slack:notify:success');
after('success', 'bibrex:version-notify');
// after('deploy', 'deploy:sentry');
// Note to self: We don't make any attempt of clearing opcache since we assume that opcache.revalidate_path=1 is set.