app\components\Folder::ansibleCopyFiles PHP Method

ansibleCopyFiles() public method

将多个文件/目录通过tar + ansible传输到指定的多个目标机
public ansibleCopyFiles ( Project $project, Task $task ) : boolean
$project app\models\Project
$task app\models\Task
return boolean
    public function ansibleCopyFiles(Project $project, TaskModel $task)
    {
        // 1. 宿主机 tar 打包
        $this->_packageFiles($project, $task);
        // 2. 传输 tar.gz 文件
        $this->_copyPackageToServerByAnsible($project, $task);
        // 3. 目标机 tar 解压
        $this->_unpackageFilesByAnsible($project, $task);
        return true;
    }