mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 16:27:39 +01:00
21 lines
667 B
PHP
21 lines
667 B
PHP
<?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.
|
|
}
|
|
});
|