-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
92 lines (75 loc) · 2.37 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/npm.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('update_code_strategy', 'clone');
set('repository', 'https://github.com/UMN-LATIS/ChimeIn2.0.git');
set('keep_releases', 5);
set('default_timeout', 600);
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Servers
host('dev')
->set('hostname', "cla-chimein-dev.oit.umn.edu")
->set('remote_user', 'swadm')
->set('labels', ['stage' => 'development'])
->set('bin/php', '/opt/remi/php81/root/usr/bin/php')
->set('deploy_path', '/swadm/var/www/html/');
host('stage')
->set('hostname', "cla-chimein-tst.oit.umn.edu")
->set('remote_user', 'swadm')
->set('labels', ['stage' => 'stage'])
->set('bin/php', '/opt/remi/php81/root/usr/bin/php')
->set('deploy_path', '/swadm/var/www/html/');
host('prod')
->set('hostname', "cla-chimein-prd.oit.umn.edu")
->set('remote_user', 'swadm')
->set('labels', ['stage' => 'production'])
->set('bin/php', '/opt/remi/php81/root/usr/bin/php')
->set('deploy_path', '/swadm/var/www/html/');
// LARAVEL RECIPE
// https://deployer.org/docs/7.x/recipe/laravel
//
// deploy:prepare
// - deploy:info
// - deploy:setup
// - deploy:lock
// - deploy:release
// - deploy:update_code
after('deploy:update_code', 'npm:install');
task('assets:generate', function () {
cd('{{release_path}}');
run('npm run build');
})->desc('Assets generation');
after('npm:install', 'assets:generate');
task('deploy:makecache', function () {
cd('{{release_path}}');
run('mkdir -p bootstrap/cache');
})->desc('Make Cache');
after('npm:install', 'deploy:makecache');
// - deploy:shared
// - deploy:writable
// deploy:vendors
// artisan:storage:link
// artisan:config:cache
// artisan:route:cache
// artisan:view:cache
// artisan:event:cache
// artisan:migrate
after('artisan:migrate', 'artisan:queue:restart');
task('composer:private', function() {
cd('{{release_path}}');
run('source .env && /swadm/var/www/html/.dep/composer.phar config "http-basic.nova.laravel.com" "$NOVA_USERNAME" "$NOVA_LICENSE_KEY"');
});
before('deploy:vendors', 'composer:private');
// deploy:publish
// - deploy:symlink
// - deploy:unlock
// - deploy:cleanup
// - deploy:success
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');