-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.php
More file actions
47 lines (34 loc) · 1.31 KB
/
common.php
File metadata and controls
47 lines (34 loc) · 1.31 KB
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
<?php
namespace Deployer;
/**
* @author Benjamin HUBERT <benjamin@alpixel.fr>
*/
set('ssh_type', 'native');
set('ssh_multiplexing', true);
after('deploy:failed', 'deploy:unlock');
task('maintenance:enable', function () {
run("mkdir -p {{current}}/web/system/ && rsync -avzh --ignore-errors {{current}}/app/Resources/themes/default/views/page/homepage.html.twig {{current}}/web/system/maintenance.html");
})->desc('Désactivation de la page de maintenance');
task('maintenance:disable', function () {
run("rm -f {{current}}/web/system/maintenance.html");
})->desc('Désactivation de la page de maintenance');
task('bower:update', function () {
$bowerPath = __DIR__ . '/../../../bower.json';
if (!is_file($bowerPath)) {
throw new InvalidArgumentException("Can't find bower.json");
}
$bowerContent = file_get_contents($bowerPath);
$bowerContent = json_decode($bowerContent);
$dependencies = [];
foreach ($bowerContent->dependencies as $key => $version) {
$dependencies[] = $key;
}
$package = null;
while (!in_array($package, $dependencies)) {
$package = ask('Quel paquet dois-je mettre à jour ?', null);
}
run("cd {{current}} && bower update ".$package);
});
task('bower:list', function () {
writeln(run("cd {{current}} && bower list"));
});