-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathsymlink.php
More file actions
23 lines (18 loc) · 733 Bytes
/
symlink.php
File metadata and controls
23 lines (18 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
namespace Deployer;
// Use mv -T if available. Will check automatically.
set('use_atomic_symlink', function () {
return commandSupportsOption('mv', '--no-target-directory');
});
desc('Creates symlink to release');
task('deploy:symlink', function () {
if (get('use_atomic_symlink')) {
run("mv -T {{deploy_path}}/release {{current_path}}");
} else {
// Atomic symlink does not supported.
// Will use simple two steps switch.
run("cd {{deploy_path}} && {{bin/symlink}} {{release_path}} {{current_path}}"); // Atomic override symlink.
run("cd {{deploy_path}} && rm release"); // Remove release link.
}
run("echo '{{user}}' > {{release_path}}/FINISHED_RELEASE");
});