2016-11-19 15:13:32 +07:00
|
|
|
<?php
|
|
|
|
namespace Deployer;
|
|
|
|
|
|
|
|
desc('Creating symlink to release');
|
|
|
|
task('deploy:symlink', function () {
|
2017-03-13 15:13:34 +07:00
|
|
|
if (get('use_atomic_symlink')) {
|
2020-10-09 01:35:42 +02:00
|
|
|
run("mv -T {{deploy_path}}/release {{current_path}}");
|
2016-11-19 15:13:32 +07:00
|
|
|
} else {
|
|
|
|
// Atomic symlink does not supported.
|
|
|
|
// Will use simple≤ two steps switch.
|
|
|
|
|
2020-10-09 01:35:42 +02:00
|
|
|
run("cd {{deploy_path}} && {{bin/symlink}} {{release_path}} {{current_path}}"); // Atomic override symlink.
|
2016-11-19 15:13:32 +07:00
|
|
|
run("cd {{deploy_path}} && rm release"); // Remove release link.
|
|
|
|
}
|
|
|
|
});
|