mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
22 lines
630 B
PHP
22 lines
630 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('Copy directories');
|
|
task('deploy:copy_dirs', function () {
|
|
$dirs = get('copy_dirs');
|
|
|
|
foreach ($dirs as $dir) {
|
|
// Delete directory if exists.
|
|
run("if [ -d $(echo {{release_path}}/$dir) ]; then rm -rf {{release_path}}/$dir; fi");
|
|
|
|
// Copy directory.
|
|
run("if [ -d $(echo {{deploy_path}}/current/$dir) ]; then cp -rpf {{deploy_path}}/current/$dir {{release_path}}/$dir; fi");
|
|
}
|
|
});
|