This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvendor_tasks.php
54 lines (49 loc) · 2.07 KB
/
vendor_tasks.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
<?php
namespace Deployer;
task('vendor:composer_setup', function () {
within(get('release_path'), function () {
$cachePath = get('deploy_path') . '/cache/vendor';
$installPath = './vendor';
if (is_dir($cachePath)) {
set('composer_action', 'update');
} else {
run("mkdir -p {$cachePath}");
set('composer_action', 'install');
}
run("ln -nfs {$cachePath} {$installPath}");
set('composer_options', '{{ composer_action }} {{ composer_flags }}');
});
})->desc('Setting up composer');
task('vendor:yarn_install', function () {
within(get('release_path'), function () {
$cachePath = get('deploy_path') . '/cache/node_modules';
$installPath = './node_modules';
if (is_dir($cachePath)) {
run("ln -nfs {$cachePath} {$installPath}");
} else {
run("mkdir -p {$cachePath}");
run("ln -nfs {$cachePath} {$installPath}");
}
run('yarn install');
});
})->desc('Installing project node dependencies (with cache)');
task('vendor:yarn_install_rsync', function () {
within(get('release_path'), function () {
$cachePath = get('deploy_path') . '/cache/node_modules';
$installPath = './node_modules';
run("yarn install --modules-folder {$cachePath}");
run("rsync -ra {$cachePath}/ {$installPath}");
});
})->desc('Installing project node dependencies (without cache)');
task('vendor:bower_install', function () {
within(get('release_path'), function () {
if (is_dir(get('deploy_path') . '/cache/bower_components')) {
run('ln -nfs {{ deploy_path }}/cache/bower_components ./bower_components');
run('yarn bower update --quiet --config.interactive=false');
} else {
run('mkdir -p {{ deploy_path }}/cache/bower_components');
run('ln -nfs {{ deploy_path }}/cache/bower_components ./bower_components');
run('yarn bower install --quiet --config.interactive=false');
}
});
})->desc('Installing project bower dependencies');