-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.php
76 lines (60 loc) · 1.79 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
<?php
namespace Deployer;
require 'recipe/zend_framework.php';
// Project name
set('application', 'batch-geocoder');
// Project repository
set('repository', 'git@github.com:geo6/batch-geocoder.git');
set('branch', 'master');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
// add('shared_files', [
// 'config/autoload/local.php',
// ]);
add('shared_dirs', [
'config/application',
'data/upload',
]);
// Writable dirs by web server
add('writable_dirs', [
'data/cache',
'data/upload',
]);
set('writable_mode', 'chown');
set('writable_use_sudo', true);
set('allow_anonymous_stats', false);
set('cleanup_use_sudo', true);
// Files/dirs to be deleted
set('clear_paths', [
'node_modules',
'deploy.php',
'Procfile',
]);
after('deploy:update_code', 'deploy:clear_paths');
// Hosts
if (file_exists('hosts.yml') && is_readable('hosts.yml')) {
inventory('hosts.yml');
}
host('sandbox')
->hostname('51.38.47.237')
->stage('sandbox')
->set('deploy_path', '/var/www/sandbox/source/batch-geocoder');
// Tasks
task('debug:enable', 'composer run development-enable');
task('debug:disable', 'composer run development-disable');
task('locale', 'composer run gettext:mo');
after('deploy:writable', 'locale');
task('install_providers', function () {
$providers = [
'geo6/geocoder-php-geo6-provider',
'geo6/geocoder-php-urbis-provider',
'geo6/geocoder-php-geopunt-provider',
'geo6/geocoder-php-spw-provider',
'geo6/geocoder-php-bpost-provider',
];
run('cd {{ release_path }} && composer require '.implode(' ', $providers));
});
after('deploy:vendors', 'install_providers');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');