-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy.php
66 lines (58 loc) · 1.4 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
<?php
require_once "recipe/common.php";
set('ssh_type', 'native');
set('default_stage', 'staging');
env('deploy_path', '/var/www');
env('composer_options', 'install --no-dev --prefer-dist --optimize-autoloader --no-progress --no-interaction');
set('copy_dirs', [
'app/commands',
'app/config',
'app/controllers',
'app/database',
'app/lang',
'app/models',
'app/src',
'app/start',
'app/tests',
'app/views',
'app/filters.php',
'app/routes.php',
'bootstrap',
'public',
'composer.json',
'composer.lock',
'artisan',
'.env',
]);
set('shared_dirs', [
'app/storage/cache',
'app/storage/logs',
'app/storage/meta',
'app/storage/sessions',
'app/storage/views',
]);
set('writable_dirs', get('shared_dirs'));
set('http_user', 'www-data');
server('digitalocean', '174.138.78.215')
->identityFile()
->user('root')
->stage('staging');
task('deploy:upload', function() {
$files = get('copy_dirs');
$releasePath = env('release_path');
foreach ($files as $file)
{
upload($file, "{$releasePath}/{$file}");
}
});
task('deploy:staging', [
'deploy:prepare',
'deploy:release',
'deploy:upload',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
'deploy:vendors',
'current',// print current release number
])->desc('Deploy application to staging.');
after('deploy:staging', 'success');