mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
22 lines
740 B
PHP
22 lines
740 B
PHP
|
<?php
|
||
|
/* (c) Anton Medvedev <anton@medv.io>
|
||
|
*
|
||
|
* For the full copyright and license information, please view the LICENSE
|
||
|
* file that was distributed with this source code.
|
||
|
*/
|
||
|
|
||
|
namespace Deployer;
|
||
|
|
||
|
desc('Creating symlink to release');
|
||
|
task('deploy:symlink', function () {
|
||
|
if (run('if [[ "$(man mv)" =~ "--no-target-directory" ]]; then echo "true"; fi')->toBool()) {
|
||
|
run("mv -T {{deploy_path}}/release {{deploy_path}}/current");
|
||
|
} else {
|
||
|
// Atomic symlink does not supported.
|
||
|
// Will use simple≤ two steps switch.
|
||
|
|
||
|
run("cd {{deploy_path}} && {{bin/symlink}} {{release_path}} current"); // Atomic override symlink.
|
||
|
run("cd {{deploy_path}} && rm release"); // Remove release link.
|
||
|
}
|
||
|
});
|