-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
52 lines (41 loc) · 1.16 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
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('repository', '[email protected]:Larastudio/lslaravel.git');
set('default_stage', 'production');
set('git_tty', true); // [Optional] Allocate tty for git on first deployment
set('ssh_type', 'native');
set('keep_releases', 10);
// Make sure uploads & published aren't overwritten by deploying
set('shared_dirs', []);
set('shared_files', [
'.env',
]);
set('writable_dirs', [
'storage/framework/cache/data',
]);
// SMART CUSTOM DEPLOY COMMANDS
task('db:migrate', function () {
run("cd {{release_path}} && php artisan migrate");
});
task('horizon:terminate', function () {
run("cd {{release_path}} && php artisan horizon:terminate");
});
// Hosts
// dep deploy production
// dep deploy staging
host('staging')
->hostname('staging.lara.studio')
->user('web')
->forwardAgent()
->stage('staging')
->set('deploy_path', '/home/web/staging.lara.studio');
host('production')
->hostname('lara.studio')
->user('web')
->forwardAgent()
->stage('production')
->set('deploy_path', '/home/web/lslaravel');
// Run database migrations
after('deploy:symlink', 'db:migrate');