-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
81 lines (63 loc) · 2.29 KB
/
Copy pathdeploy.php
File metadata and controls
81 lines (63 loc) · 2.29 KB
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
71
72
73
74
75
76
77
78
79
80
81
<?php
namespace Deployer;
// require 'contrib/laravel.php';
require 'contrib/npm.php';
require 'recipe/laravel.php';
require 'contrib/cachetool.php';
set('cachetool_args', '--tmp-dir=/var/www/bluesheet');
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('git_ssh_command', 'ssh -o StrictHostKeyChecking=no');
set('update_code_strategy', 'clone');
set('repository', 'git@github.com:umn-latis/bluesheet.git');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Servers
$devHost = 'cla-bluesheet-dev.oit.umn.edu';
$tstHost = 'cla-bluesheet-tst.oit.umn.edu';
$prodHost = 'cla-bluesheet-prd.oit.umn.edu';
host('dev')
->set('hostname', $devHost)
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'development'])
// ->identityFile()
->set('deploy_path', '/var/www/bluesheet/');
host('stage')
->set('hostname', $tstHost)
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'stage'])
// ->identityFile()
->set('deploy_path', '/var/www/bluesheet/');
host('prod')
->set('hostname', $prodHost)
->set('remote_user', 'latis_deploy')
->set('labels', ['stage' => 'production'])
->set('deploy_path', '/var/www/bluesheet/');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// after('deploy:update_code', 'deploy:git:submodules');
// task('deploy:git:submodules', function () {
// $git = get('bin/git');
// cd('{{release_path}}');
// run("$git submodule update --init");
// });
// install private composer packages, like Laravel Nova
task('composer:private', function () {
cd('{{release_path}}');
run('source .env && {{bin/composer}} config "http-basic.nova.laravel.com" "$NOVA_USERNAME" "$NOVA_LICENSE_KEY"');
});
before('deploy:vendors', 'composer:private');
// Migrate database before symlink new release.
before('deploy:symlink', 'artisan:migrate');
after('deploy:update_code', 'npm:install');
task('assets:generate', function () {
cd('{{release_path}}');
run('npm run build');
})->desc('Assets generation');
after('deploy:vendors', 'assets:generate');
after('artisan:migrate', 'artisan:queue:restart');
// clear any cached data, like cached instructor info,
before('artisan:config:cache', 'artisan:cache:clear');
after('deploy:symlink', 'cachetool:clear:opcache');