-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipe.php
46 lines (34 loc) · 1.11 KB
/
recipe.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
<?php
namespace Deployer;
set('bin/nanbando', 'nanbando.phar');
set('nanbando_backup_options', '');
set('nanbando_push', true);
set('nanbando', true);
set('nanbando_enabled', function () {
if (!get('nanbando')) {
return false;
}
$releases = get('releases_list', []);
return 0 < count($releases);
});
task('nanbando:plugins:install', function () {
if (!get('nanbando_enabled')) {
return;
}
run('cd {{current_path}} && {{bin/php}} {{bin/nanbando}} plugins:install');
})->desc('nanbando plugins:install');
task('nanbando:backup', function () {
if (!get('nanbando_enabled')) {
return;
}
run('cd {{current_path}} && {{bin/php}} {{bin/nanbando}} backup {{nanbando_backup_options}}');
})->desc('nanbando backup');
task('nanbando:push', function () {
if (!get('nanbando_push') || !get('nanbando_enabled')) {
return;
}
run('cd {{current_path}} && {{bin/php}} {{bin/nanbando}} push');
})->desc('nanbando push');
before('nanbando:backup', 'nanbando:plugins:install');
after('nanbando:backup', 'nanbando:push');
before('deploy:prepare', 'nanbando:backup');